Skip to content

Commit 9d661ab

Browse files
committed
Minor improvements
1 parent 441e07a commit 9d661ab

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

benchexec/tools/ultimate.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def executable(self, tool_locator):
7676
exe = tool_locator.find_executable("Ultimate.py")
7777
dir_name = Path(os.path.dirname(exe))
7878
logging.debug("Checking if %s contains a launcher jar", dir_name)
79-
if list(dir_name.glob(_JAR_LAUNCHER_PATTERN)):
79+
if any(dir_name.glob(_JAR_LAUNCHER_PATTERN)):
8080
return exe
8181
msg = (
8282
f"ERROR: Did find a Ultimate.py in {os.path.dirname(exe)} "
@@ -164,14 +164,12 @@ def _query_ultimate_version(self, cmd, api):
164164
@functools.lru_cache
165165
def _get_current_launcher_jar(self, executable):
166166
ultimate_dir = os.path.dirname(executable)
167-
launcher_candidates = glob.glob(
168-
os.path.join(ultimate_dir, _JAR_LAUNCHER_PATTERN)
169-
)
167+
launcher_candidates = glob(_JAR_LAUNCHER_PATTERN, root_dir=ultimate_dir)
170168
if not launcher_candidates:
171169
raise FileNotFoundError(f"No suitable launcher jar found in {ultimate_dir}")
172170
if len(launcher_candidates) > 1:
173171
raise FileNotFoundError(f"Multiple launcher jars found in {ultimate_dir}")
174-
return launcher_candidates[0]
172+
return os.path.join(ultimate_dir, launcher_candidates[0])
175173

176174
@functools.lru_cache
177175
def version(self, executable):

0 commit comments

Comments
 (0)