Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.

Commit c903f58

Browse files
committed
test.py: remove return in finally, which Python warns about
1 parent ba680bc commit c903f58

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ def print_log_tail_on_fail(script_path):
107107
except OSError:
108108
print(f"could not remove {compile_commands}")
109109

110-
111-
success = False
112-
113110
# noinspection PyBroadException
114111
try:
115112
if verbose:
@@ -124,7 +121,7 @@ def print_log_tail_on_fail(script_path):
124121
color = Colors.WARNING if xfail else Colors.OKGREEN
125122
msg = "OK_XFAIL" if xfail else "OK"
126123
print(f"{line}{fill} {color}{msg}{Colors.NO_COLOR}")
127-
success = True
124+
return True
128125
except KeyboardInterrupt:
129126
if not verbose:
130127
print("{line}: {color}INTERRUPT{nocolor}".format(
@@ -142,8 +139,7 @@ def print_log_tail_on_fail(script_path):
142139
nocolor=Colors.NO_COLOR)
143140
)
144141
print_log_tail_on_fail(script_path)
145-
finally:
146-
return success
142+
return False
147143

148144
def ensure_submodule_checkout(self):
149145
# make sure the `repo` directory exists and is not empty

0 commit comments

Comments
 (0)