diff --git a/scripts/bytecodecompare/prepare_report.py b/scripts/bytecodecompare/prepare_report.py index dd317735f..90901e8b7 100755 --- a/scripts/bytecodecompare/prepare_report.py +++ b/scripts/bytecodecompare/prepare_report.py @@ -251,7 +251,7 @@ def detect_metadata_cli_option_support(compiler_path: Path): f"Compiler output:\n{process.stderr}\n", file=sys.stderr ) - raise Exception("Failed to determine if the compiler supports the --metadata option.") + raise RuntimeError("Failed to determine if the compiler supports the --metadata option.") return process.returncode == 0 diff --git a/scripts/gas_diff_stats.py b/scripts/gas_diff_stats.py index 56cd0cd43..234d42df0 100755 --- a/scripts/gas_diff_stats.py +++ b/scripts/gas_diff_stats.py @@ -75,7 +75,7 @@ def collect_statistics(lines) -> (int, int, int, int, int, int): """ if not lines: - raise Exception("Empty list") + raise RuntimeError("Empty list") def try_parse(line): try: diff --git a/scripts/pylintrc b/scripts/pylintrc index 3a2b85293..735810ad5 100644 --- a/scripts/pylintrc +++ b/scripts/pylintrc @@ -23,6 +23,7 @@ disable= no-else-return, pointless-string-statement, redefined-outer-name, + superfluous-parens, too-few-public-methods, too-many-arguments, too-many-branches, diff --git a/test/lsp.py b/test/lsp.py index 2e097dab0..669951ca4 100755 --- a/test/lsp.py +++ b/test/lsp.py @@ -591,7 +591,7 @@ class FileTestRunner: for diagnostics in published_diagnostics: if not diagnostics["uri"].startswith(self.suite.project_root_uri + "/"): - raise Exception( + raise RuntimeError( f"'{self.test_name}.sol' imported file outside of test directory: '{diagnostics['uri']}'" ) self.open_tests.append(self.suite.normalizeUri(diagnostics["uri"])) @@ -804,9 +804,9 @@ class FileTestRunner: if tag == desired_tag: return tagRange elif tag.lower() == desired_tag.lower(): - raise Exception(f"Detected lower/upper case mismatch: Requested {desired_tag} but only found {tag}") + raise RuntimeError(f"Detected lower/upper case mismatch: Requested {desired_tag} but only found {tag}") - raise Exception(f"Marker {desired_tag} not found in file") + raise RuntimeError(f"Marker {desired_tag} not found in file") # Check if we need markers from a specific file @@ -1032,7 +1032,7 @@ class SolidityLSPTestSuite: # {{{ tag = self.find_tag_with_range(testname, local_sub_dir, diagnostic['range']) if tag is None: - raise Exception(f"No tag found for diagnostic range {diagnostic['range']}") + raise RuntimeError(f"No tag found for diagnostic range {diagnostic['range']}") expectations += f" {tag} {diagnostic['code']}" expectations += "\n"