Skip to content

Commit 836e1ee

Browse files
authored
Merge pull request #13914 from ethereum/pylint-2.16-fix
Fix pylint 2.16 warnings
2 parents 37953a7 + 828f95a commit 836e1ee

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

scripts/bytecodecompare/prepare_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def detect_metadata_cli_option_support(compiler_path: Path):
251251
f"Compiler output:\n{process.stderr}\n",
252252
file=sys.stderr
253253
)
254-
raise Exception("Failed to determine if the compiler supports the --metadata option.")
254+
raise RuntimeError("Failed to determine if the compiler supports the --metadata option.")
255255

256256
return process.returncode == 0
257257

scripts/gas_diff_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def collect_statistics(lines) -> (int, int, int, int, int, int):
7575
7676
"""
7777
if not lines:
78-
raise Exception("Empty list")
78+
raise RuntimeError("Empty list")
7979

8080
def try_parse(line):
8181
try:

scripts/pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ disable=
2323
no-else-return,
2424
pointless-string-statement,
2525
redefined-outer-name,
26+
superfluous-parens,
2627
too-few-public-methods,
2728
too-many-arguments,
2829
too-many-branches,

test/lsp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def test_diagnostics(self):
591591

592592
for diagnostics in published_diagnostics:
593593
if not diagnostics["uri"].startswith(self.suite.project_root_uri + "/"):
594-
raise Exception(
594+
raise RuntimeError(
595595
f"'{self.test_name}.sol' imported file outside of test directory: '{diagnostics['uri']}'"
596596
)
597597
self.open_tests.append(self.suite.normalizeUri(diagnostics["uri"]))
@@ -804,9 +804,9 @@ def findMarker(desired_tag):
804804
if tag == desired_tag:
805805
return tagRange
806806
elif tag.lower() == desired_tag.lower():
807-
raise Exception(f"Detected lower/upper case mismatch: Requested {desired_tag} but only found {tag}")
807+
raise RuntimeError(f"Detected lower/upper case mismatch: Requested {desired_tag} but only found {tag}")
808808

809-
raise Exception(f"Marker {desired_tag} not found in file")
809+
raise RuntimeError(f"Marker {desired_tag} not found in file")
810810

811811

812812
# Check if we need markers from a specific file
@@ -1032,7 +1032,7 @@ def fetch_and_format_diagnostics(self, solc: JsonRpcProcess, test, sub_dir=None)
10321032
tag = self.find_tag_with_range(testname, local_sub_dir, diagnostic['range'])
10331033

10341034
if tag is None:
1035-
raise Exception(f"No tag found for diagnostic range {diagnostic['range']}")
1035+
raise RuntimeError(f"No tag found for diagnostic range {diagnostic['range']}")
10361036

10371037
expectations += f" {tag} {diagnostic['code']}"
10381038
expectations += "\n"

0 commit comments

Comments
 (0)