Skip to content

Commit c2f9b95

Browse files
Merge pull request #1239 from saurabh12nxf/update-flake8-1159
Update flake8 to latest version (fixes #1159)
2 parents b693d22 + 0929782 commit c2f9b95

11 files changed

Lines changed: 15 additions & 14 deletions

File tree

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ flake8:
127127
stage: test
128128
image: python:3.10
129129
before_script:
130-
- "pip install 'flake8<6' flake8-awesome"
130+
- pip install setuptools flake8 flake8-awesome
131131
script:
132132
- flake8
133133
<<: *pip-cache

benchexec/check_cgroups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __init__(self, options):
119119
def run(self):
120120
try:
121121
check_cgroup_availability(self.options.wait)
122-
except BaseException as e:
122+
except BaseException as e: # noqa: B036
123123
self.error = e
124124

125125

benchexec/containerexecutor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def _start_execution(
543543
memlimit=memlimit,
544544
memory_nodes=memory_nodes,
545545
result_files_patterns=result_files_patterns,
546-
*args,
546+
*args, # noqa: B026
547547
**kwargs,
548548
)
549549
if result is not None:
@@ -662,7 +662,7 @@ def grandchild():
662662
if use_cgroup_ns:
663663
container.setup_cgroup_namespace()
664664
container.drop_capabilities()
665-
except BaseException as e:
665+
except BaseException as e: # noqa: B036
666666
# When using runexec, this logging will end up in the output.log file,
667667
# where usually the tool output is. This is suboptimal, but probably
668668
# better than swallowing it. (In cases where this logs something,
@@ -853,7 +853,7 @@ def child():
853853
else:
854854
logging.exception("Error in child process of RunExecutor")
855855
return CHILD_UNKNOWN_ERROR
856-
except BaseException:
856+
except BaseException: # noqa: B036
857857
# Need to catch everything because this method always needs to return an
858858
# int (we are inside a C callback that requires returning int).
859859
logging.exception("Error in child process of RunExecutor")

benchexec/containerized_tool.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ def _call_tool_func(name, args, kwargs):
285285
@param args: List of arguments to be passed as positional arguments.
286286
@param kwargs: Dict of arguments to be passed as keyword arguments.
287287
"""
288-
global tool
289288
try:
290289
return getattr(tool, name)(*args, **kwargs)
291290
except SystemExit as e:

benchexec/localexecution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def run(self):
287287
logging.critical(e)
288288
except BenchExecException as e:
289289
logging.critical(e)
290-
except BaseException:
290+
except BaseException: # noqa: B036
291291
logging.exception("Exception during run execution")
292292
self.run_finished_callback()
293293
_Worker.working_queue.task_done()

benchexec/tablegenerator/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,5 @@ class TableDefinitionError(Exception):
422422
"""
423423

424424
def __init__(self, message):
425+
super().__init__(message)
425426
self.message = message

benchexec/test_runexecutor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,9 @@ def get_runexec_cmdline(self, *args, **kwargs):
951951

952952
def execute_run(self, *args, **kwargs):
953953
return super(TestRunExecutorWithContainer, self).execute_run(
954-
workingDir="/tmp", *args, **kwargs
954+
workingDir="/tmp",
955+
*args, # noqa: B026
956+
**kwargs,
955957
)
956958

957959
def test_home_and_tmp_is_separate(self):

benchexec/test_tool_info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def log_if_unsupported(msg):
9292
"""Catch any exception in block and log it with a message about an unsupported feature"""
9393
try:
9494
yield # call code block to be executed
95-
except BaseException as e:
95+
except BaseException as e: # noqa: B036
9696
logging.warning(
9797
"Tool-info module does not support %s: “%s”",
9898
msg,
@@ -134,7 +134,7 @@ def print_tool_info(tool, tool_locator):
134134
version = None
135135
try:
136136
version = tool.version(executable)
137-
except BaseException:
137+
except BaseException: # noqa: B036
138138
logging.warning("Determining version failed:", exc_info=1)
139139
if version:
140140
print_value("Version", tool.version(executable))
@@ -327,7 +327,7 @@ def analyze_tool_output(tool, file, dummy_cmdline):
327327
result,
328328
extra_line=True,
329329
)
330-
except BaseException:
330+
except BaseException: # noqa: B036
331331
logging.warning(
332332
"Tool module failed to analyze result in “%s”:", file.name, exc_info=1
333333
)

benchexec/tools/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_load_tool_info_module(self):
3434
logging.warning(
3535
"Cannot load tool-info module %s: %s", tool_info_name, e
3636
)
37-
except BaseException as e:
37+
except BaseException as e: # noqa: B036
3838
self.fail(f"Loading tool-info module {tool_info_name} failed: {e}")
3939

4040

contrib/aws/awsexecutor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ def execute_benchmark(benchmark, output_handler):
255255

256256

257257
def stop():
258-
global event_handler
259258
event_handler.set()
260259
global STOPPED_BY_INTERRUPT
261260
STOPPED_BY_INTERRUPT = True

0 commit comments

Comments
 (0)