diff --git a/benchexec/cgroupsv1.py b/benchexec/cgroupsv1.py index 7b345e212..145a64c59 100644 --- a/benchexec/cgroupsv1.py +++ b/benchexec/cgroupsv1.py @@ -521,7 +521,7 @@ def read_io_pressure(self): def read_usage_per_cpu(self): usage = {} - for (core, coretime) in enumerate( + for core, coretime in enumerate( self.get_value(self.CPU, "usage_percpu").split(" ") ): try: diff --git a/benchexec/check_cgroups.py b/benchexec/check_cgroups.py index 143e535db..4e9520acc 100644 --- a/benchexec/check_cgroups.py +++ b/benchexec/check_cgroups.py @@ -95,7 +95,6 @@ def check_cgroup_availability_in_thread(options): class _CheckCgroupsThread(threading.Thread): - error = None def __init__(self, options): diff --git a/benchexec/localexecution.py b/benchexec/localexecution.py index 0fd789595..a60cdf1c8 100644 --- a/benchexec/localexecution.py +++ b/benchexec/localexecution.py @@ -54,7 +54,6 @@ def get_system_info(): def execute_benchmark(benchmark, output_handler): - run_sets_executed = 0 logging.debug("I will use %s threads.", benchmark.num_of_threads) @@ -139,7 +138,6 @@ def execute_benchmark(benchmark, output_handler): # iterate over run sets for runSet in benchmark.run_sets: - if STOPPED_BY_INTERRUPT: break diff --git a/benchexec/model.py b/benchexec/model.py index bb925da30..dca3ae8c3 100644 --- a/benchexec/model.py +++ b/benchexec/model.py @@ -423,7 +423,7 @@ def handle_limit_value(name, from_key, to_key, cmdline_value, parse_fn): # get benchmarks self.run_sets = [] - for (i, rundefinitionTag) in enumerate(rootTag.findall("rundefinition")): + for i, rundefinitionTag in enumerate(rootTag.findall("rundefinition")): self.run_sets.append( RunSet(rundefinitionTag, self, i + 1, globalSourcefilesTags) ) @@ -690,7 +690,6 @@ def _read_set_file(filename): # get sourcefiles from list in file for includesFilesFile in sourcefilesTag.findall("includesfile"): - for file in self.expand_filename_pattern(includesFilesFile.text, base_dir): input_files_in_set = list(_read_set_file(file)) if not input_files_in_set: @@ -1200,13 +1199,11 @@ class Requirements(object): """ def __init__(self, tags, rlimits, config): - self.cpu_model = None self.memory = None self.cpu_cores = None for requireTag in tags: - cpu_model = requireTag.get("cpuModel", None) if cpu_model: if self.cpu_model is None: diff --git a/benchexec/outputhandler.py b/benchexec/outputhandler.py index 0dc02e8cb..dd6c2556b 100644 --- a/benchexec/outputhandler.py +++ b/benchexec/outputhandler.py @@ -182,7 +182,6 @@ def set_error(self, msg, runSet=None): runSet.xml.set("error", msg or "unknown error") def store_header_in_xml(self, version, memlimit, timelimit, corelimit): - # store benchmarkInfo in XML self.xml_header = ElementTree.Element( "result", @@ -506,7 +505,6 @@ def output_after_run(self, run): # format numbers, number_of_digits is optional, so it can be None for column in run.columns: if column.number_of_digits is not None: - # if the number ends with "s" or another letter, remove it if (not column.value.isdigit()) and column.value[-2:-1].isdigit(): column.value = column.value[:-1] diff --git a/benchexec/resources.py b/benchexec/resources.py index ededf0f6f..aa437505f 100644 --- a/benchexec/resources.py +++ b/benchexec/resources.py @@ -352,7 +352,8 @@ def get_memory_banks_per_run(coreAssignment, cgroups): def _get_memory_banks_listed_in_dir(path): """Get all memory banks the kernel lists in a given directory. Such a directory can be /sys/devices/system/node/ (contains all memory banks) - or /sys/devices/system/cpu/cpu*/ (contains all memory banks on the same NUMA node as that core).""" + or /sys/devices/system/cpu/cpu*/ (contains all memory banks on the same NUMA node as that core). + """ # Such directories contain entries named "node" for each memory bank return [int(entry[4:]) for entry in os.listdir(path) if entry.startswith("node")] diff --git a/benchexec/runexecutor.py b/benchexec/runexecutor.py index 6dd657500..5f41b7bb8 100644 --- a/benchexec/runexecutor.py +++ b/benchexec/runexecutor.py @@ -313,7 +313,6 @@ def print_optional_result(key, unit=""): class RunExecutor(containerexecutor.ContainerExecutor): - # --- object initialization --- def __init__( @@ -442,7 +441,7 @@ def _setup_cgroups(self, my_cpus, memlimit, memory_nodes, cgroup_values): logging.debug("Created cgroups %s.", cgroups) # First, set user-specified values such that they get overridden by our settings if necessary. - for ((subsystem, option), value) in cgroup_values.items(): + for (subsystem, option), value in cgroup_values.items(): try: cgroups.set_value(subsystem, option, value) except OSError as e: @@ -727,7 +726,7 @@ def execute_run( self.cgroups.handle_errors(critical_cgroups) - for ((subsystem, option), _) in cgroupValues.items(): + for (subsystem, option), _ in cgroupValues.items(): if subsystem not in self._cgroup_subsystems: sys.exit( f'Cannot set option "{option}" for subsystem "{subsystem}" ' diff --git a/benchexec/tablegenerator/columns.py b/benchexec/tablegenerator/columns.py index c6920f82e..cc39c7643 100644 --- a/benchexec/tablegenerator/columns.py +++ b/benchexec/tablegenerator/columns.py @@ -149,7 +149,6 @@ def __init__( relevant_for_diff=None, display_title=None, ): - # If scaling on the variables is performed, a display unit must be defined, explicitly if scale_factor is not None and scale_factor != 1 and unit is None: raise util.TableDefinitionError( @@ -458,7 +457,6 @@ def _get_column_type_heur(column, column_values): explicit_scale_defined = True for value in column_values: - if value is None or value == "": continue @@ -608,7 +606,6 @@ def _get_decimal_digits(decimal_number_match, number_of_significant_digits): int(decimal_number_match.group(GROUP_INT_PART)) == 0 and int(decimal_number_match.group(GROUP_DEC_PART)[1:]) != 0 ): - max_num_of_digits = len(decimal_number_match.group(GROUP_SIG_DEC_PART)) num_of_digits = min(num_of_digits, max_num_of_digits) # number of needed decimal digits = number of zeroes after decimal point + significant digits diff --git a/benchexec/tablegenerator/statistics.py b/benchexec/tablegenerator/statistics.py index 4f7083c31..a8dc40662 100644 --- a/benchexec/tablegenerator/statistics.py +++ b/benchexec/tablegenerator/statistics.py @@ -263,7 +263,6 @@ def add_local_summary_statistics(run_set_result, run_set_stats): and column.title in run_set_result.summary and run_set_result.summary[column.title] != "" ): - try: column_stats.local = StatValue( util.to_decimal(run_set_result.summary[column.title]) diff --git a/benchexec/tablegenerator/test_integration/__init__.py b/benchexec/tablegenerator/test_integration/__init__.py index 996bdf595..2695b9ca4 100644 --- a/benchexec/tablegenerator/test_integration/__init__.py +++ b/benchexec/tablegenerator/test_integration/__init__.py @@ -35,7 +35,6 @@ def result_file(name): class TableGeneratorIntegrationTests(unittest.TestCase): - # Tests compare the generated CSV files and ignore the HTML files # because we assume the HTML files change more often on purpose. diff --git a/benchexec/tools/blast.py b/benchexec/tools/blast.py index b90800b14..7c3a83df7 100644 --- a/benchexec/tools/blast.py +++ b/benchexec/tools/blast.py @@ -13,7 +13,6 @@ class Tool(benchexec.tools.template.BaseTool): - REQUIRED_PATHS = ["etv", "bin"] def blast_exe(self): diff --git a/benchexec/tools/ceagle.py b/benchexec/tools/ceagle.py index 7996a125b..4aa8232eb 100644 --- a/benchexec/tools/ceagle.py +++ b/benchexec/tools/ceagle.py @@ -11,7 +11,6 @@ class Tool(benchexec.tools.template.BaseTool): - REQUIRED_PATHS = ["sv-ceagle", "z3"] def executable(self): @@ -28,7 +27,6 @@ def cmdline(self, executable, options, tasks, propertyfile, rlimits): return [executable] + options + spec + tasks def determine_result(self, returncode, returnsignal, output, isTimeout): - stroutput = str(output) if isTimeout: diff --git a/benchexec/tools/civl.py b/benchexec/tools/civl.py index 7fc08f0af..2706f7d1f 100644 --- a/benchexec/tools/civl.py +++ b/benchexec/tools/civl.py @@ -11,7 +11,6 @@ class Tool(benchexec.tools.template.BaseTool): - REQUIRED_PATHS = ["civl", "lib", "provers"] def executable(self): diff --git a/benchexec/tools/depthk.py b/benchexec/tools/depthk.py index 698083847..525972f84 100644 --- a/benchexec/tools/depthk.py +++ b/benchexec/tools/depthk.py @@ -31,7 +31,6 @@ class Tool(benchexec.tools.template.BaseTool): ] def executable(self): - return util.find_executable("depthk-wrapper.sh") def working_directory(self, executable): @@ -51,14 +50,12 @@ def name(self): return "DepthK" def cmdline(self, executable, options, tasks, propertyfile, rlimits): - assert len(tasks) == 1, "only one sourcefile supported" assert propertyfile, "property file required" sourcefile = tasks[0] return [executable] + options + ["-c", propertyfile, sourcefile] def determine_result(self, returncode, returnsignal, output, isTimeout): - if len(output) <= 0: return result.RESULT_ERROR @@ -85,7 +82,6 @@ def determine_result(self, returncode, returnsignal, output, isTimeout): return status def get_value_from_output(self, lines, identifier): - for line in lines: if identifier == "k" and line.startswith("Bound k:"): matchbound = re.search(r"Bound k:(.*)", line) diff --git a/benchexec/tools/forester.py b/benchexec/tools/forester.py index 3a617dbfe..e537c7d80 100644 --- a/benchexec/tools/forester.py +++ b/benchexec/tools/forester.py @@ -11,7 +11,6 @@ class Tool(benchexec.tools.template.BaseTool): - REQUIRED_PATHS = ["include", "libfa.so", "sv_comp_run.py"] def executable(self): diff --git a/benchexec/tools/fusebmc.py b/benchexec/tools/fusebmc.py index 9cc56b542..91439c114 100644 --- a/benchexec/tools/fusebmc.py +++ b/benchexec/tools/fusebmc.py @@ -30,7 +30,6 @@ def name(self): return "FuSeBMC" def cmdline(self, executable, options, task, rlimits): - if task.property_file: options = options + ["-p", task.property_file] else: diff --git a/benchexec/tools/hiptnt.py b/benchexec/tools/hiptnt.py index 983e187de..e4ec3b447 100644 --- a/benchexec/tools/hiptnt.py +++ b/benchexec/tools/hiptnt.py @@ -11,7 +11,6 @@ class Tool(benchexec.tools.template.BaseTool): - REQUIRED_PATHS = [ "fixcalc", "hip", diff --git a/benchexec/tools/lctd.py b/benchexec/tools/lctd.py index fe8dd7ca5..c4a90e184 100644 --- a/benchexec/tools/lctd.py +++ b/benchexec/tools/lctd.py @@ -11,7 +11,6 @@ class Tool(benchexec.tools.template.BaseTool): - REQUIRED_PATHS = [ "bin", "include", diff --git a/benchexec/tools/seahorn.py b/benchexec/tools/seahorn.py index fd0f67b37..ae2670304 100644 --- a/benchexec/tools/seahorn.py +++ b/benchexec/tools/seahorn.py @@ -17,7 +17,6 @@ class Tool(benchexec.tools.template.BaseTool): - REQUIRED_PATHS = ["bin", "include", "lib", "share"] def executable(self): diff --git a/benchexec/tools/skink.py b/benchexec/tools/skink.py index c82032cca..9cd656249 100644 --- a/benchexec/tools/skink.py +++ b/benchexec/tools/skink.py @@ -12,7 +12,6 @@ class Tool(benchexec.tools.template.BaseTool): - REQUIRED_PATHS = [ "bin", "lib", diff --git a/benchexec/tools/smack.py b/benchexec/tools/smack.py index 0e4d7dde0..2df3c30bb 100644 --- a/benchexec/tools/smack.py +++ b/benchexec/tools/smack.py @@ -12,7 +12,6 @@ class Tool(benchexec.tools.template.BaseTool2): - REQUIRED_PATHS = [ "bin", "lib", diff --git a/benchexec/tools/smtlib2.py b/benchexec/tools/smtlib2.py index 273766253..e21cbdf02 100644 --- a/benchexec/tools/smtlib2.py +++ b/benchexec/tools/smtlib2.py @@ -16,7 +16,6 @@ class Smtlib2Tool(benchexec.tools.template.BaseTool): """ def determine_result(self, returncode, returnsignal, output, isTimeout): - if returnsignal == 0 and returncode == 0: status = None for line in output: diff --git a/benchexec/tools/ultimate.py b/benchexec/tools/ultimate.py index 1fadc6ca2..bb0efe61f 100644 --- a/benchexec/tools/ultimate.py +++ b/benchexec/tools/ultimate.py @@ -70,7 +70,7 @@ def executable(self, tool_locator): exe = tool_locator.find_executable("Ultimate.py") dir_name = os.path.dirname(exe) logging.debug("Looking in %s for Ultimate and plugins/", dir_name) - for (_, dir_names, file_names) in os.walk(dir_name): + for _, dir_names, file_names in os.walk(dir_name): if "Ultimate" in file_names and "plugins" in dir_names: return exe break diff --git a/benchexec/tools/viap.py b/benchexec/tools/viap.py index ee127b678..2e3e0994c 100644 --- a/benchexec/tools/viap.py +++ b/benchexec/tools/viap.py @@ -11,7 +11,6 @@ class Tool(benchexec.tools.template.BaseTool): - REQUIRED_PATHS = [ "viap_tool.py", "viap_svcomp.py", diff --git a/benchexec/tools/wasp-c.py b/benchexec/tools/wasp-c.py index 0792fca46..a94184845 100644 --- a/benchexec/tools/wasp-c.py +++ b/benchexec/tools/wasp-c.py @@ -26,7 +26,6 @@ def name(self): return "WASP-C" def cmdline(self, executable, options, task, rlimits): - if task.property_file: options = options + ["--property", task.property_file] else: diff --git a/benchexec/tools/yogar-cbmc-parallel.py b/benchexec/tools/yogar-cbmc-parallel.py index c4e26af77..208730e31 100644 --- a/benchexec/tools/yogar-cbmc-parallel.py +++ b/benchexec/tools/yogar-cbmc-parallel.py @@ -11,7 +11,6 @@ class Tool(yogar_cbmc.Tool): - REQUIRED_PATHS = ["yogar-cbmc"] def executable(self): diff --git a/benchexec/tools/yogar-cbmc.py b/benchexec/tools/yogar-cbmc.py index e5dee8bb9..7c5fa44a8 100644 --- a/benchexec/tools/yogar-cbmc.py +++ b/benchexec/tools/yogar-cbmc.py @@ -25,7 +25,6 @@ def cmdline(self, executable, options, tasks, propertyfile, rlimits): return [executable] + options + tasks def determine_result(self, returncode, returnsignal, output, isTimeout): - status = result.RESULT_UNKNOWN stroutput = str(output) diff --git a/benchexec/util.py b/benchexec/util.py index a1761408f..84f129225 100644 --- a/benchexec/util.py +++ b/benchexec/util.py @@ -295,7 +295,7 @@ def substitute_vars(template, replacements): @param replacements: a dict or a list of pairs of keys and values """ result = template - for (key, value) in replacements: + for key, value in replacements: result = result.replace("${" + key + "}", value) if "${" in result: logging.warning("A variable was not replaced in '%s'.", result) diff --git a/contrib/aws/awsexecutor.py b/contrib/aws/awsexecutor.py index 244f77d1c..6a6cf7f46 100644 --- a/contrib/aws/awsexecutor.py +++ b/contrib/aws/awsexecutor.py @@ -416,7 +416,6 @@ def getBenchmarkData(benchmark): def getToolData(benchmark): - working_dir = benchmark.working_directory() if not os.path.isdir(working_dir): raise BenchExecException( @@ -445,7 +444,6 @@ def bytes_to_mb(mb): def handleCloudResults(benchmark, output_handler, start_time, end_time): - output_dir = benchmark.log_folder if not os.path.isdir(output_dir) or not os.listdir(output_dir): # output_dir does not exist or is empty diff --git a/contrib/p4/p4-test-tool.py b/contrib/p4/p4-test-tool.py index 9150b1374..fc346e64b 100644 --- a/contrib/p4/p4-test-tool.py +++ b/contrib/p4/p4-test-tool.py @@ -9,7 +9,6 @@ class Tool(benchexec.tools.template.BaseTool2): - # Needed for benchexec to run, but irrelevant for p4 extension def executable(self, tool): return "/" diff --git a/contrib/p4/p4execution.py b/contrib/p4/p4execution.py index c8c386dba..039a5aa2b 100644 --- a/contrib/p4/p4execution.py +++ b/contrib/p4/p4execution.py @@ -215,7 +215,6 @@ def execute_benchmark(self, benchmark, output_handler): # Check for table output file if os.path.exists(switch_command_output): - copyfile(switch_command_output, switch_command_output_new) else: logging.info("No tables was loaded for switch: %s, {switch.name}") @@ -304,7 +303,6 @@ def execute_benchmark(self, benchmark, output_handler): self.close() def _execute_benchmark(self, run, command): - return self.ptf_tester.exec_run(command, tty=True) def setup_network(self): @@ -506,7 +504,6 @@ def get_system_info(self): return systeminfo.SystemInfo() def read_folder_paths(self, benchmark): - switch_folder = "" ptf_folder = "" network_config = "" diff --git a/contrib/vcloud/benchmarkclient_executor.py b/contrib/vcloud/benchmarkclient_executor.py index 33af8ba1f..fd2c99af5 100644 --- a/contrib/vcloud/benchmarkclient_executor.py +++ b/contrib/vcloud/benchmarkclient_executor.py @@ -157,7 +157,6 @@ def toTabList(items): def getCloudInput(benchmark): - ( requirements, numberOfRuns, @@ -202,7 +201,6 @@ def getCloudInput(benchmark): def getBenchmarkDataForCloud(benchmark): - # get requirements r = benchmark.requirements requirements = [ @@ -261,7 +259,6 @@ def getBenchmarkDataForCloud(benchmark): def getToolDataForCloud(benchmark): - workingDir = benchmark.working_directory() if not os.path.isdir(workingDir): sys.exit(f"Missing working directory '{workingDir}', cannot run tool.") @@ -290,7 +287,6 @@ def getToolDataForCloud(benchmark): def handleCloudResults(benchmark, output_handler, start_time, end_time): - outputDir = benchmark.log_folder if not os.path.isdir(outputDir) or not os.listdir(outputDir): # outputDir does not exist or is empty