Skip to content

Commit 0a6764f

Browse files
committed
style(lint): fix python builtin shadowing (in ruff 0.8.2)
This was required after upgrading ruff from 0.7.1 to 0.8.2
1 parent 44ded64 commit 0a6764f

File tree

7 files changed

+12
-14
lines changed

7 files changed

+12
-14
lines changed

src/ethereum_clis/clis/besu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import tempfile
88
import textwrap
99
from pathlib import Path
10-
from re import compile
1110
from typing import List, Optional
1211

1312
import requests
@@ -29,7 +28,7 @@ class BesuTransitionTool(TransitionTool):
2928
"""Besu EvmTool Transition tool frontend wrapper class."""
3029

3130
default_binary = Path("evm")
32-
detect_binary_pattern = compile(r"^Hyperledger Besu evm .*$")
31+
detect_binary_pattern = re.compile(r"^Hyperledger Besu evm .*$")
3332
binary: Path
3433
cached_version: Optional[str] = None
3534
trace: bool

src/ethereum_clis/clis/ethereumjs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""EthereumJS Transition tool interface."""
22

3+
import re
34
from pathlib import Path
4-
from re import compile
55
from typing import Optional
66

77
from ethereum_test_exceptions import (
@@ -19,7 +19,7 @@ class EthereumJSTransitionTool(TransitionTool):
1919
"""EthereumJS Transition tool interface wrapper class."""
2020

2121
default_binary = Path("ethereumjs-t8ntool.sh")
22-
detect_binary_pattern = compile(r"^ethereumjs t8n\b")
22+
detect_binary_pattern = re.compile(r"^ethereumjs t8n\b")
2323
version_flag: str = "--version"
2424
t8n_use_stream = False
2525

src/ethereum_clis/clis/evmone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Evmone Transition tool interface."""
22

3+
import re
34
from pathlib import Path
4-
from re import compile
55
from typing import Optional
66

77
from ethereum_test_exceptions import (
@@ -19,7 +19,7 @@ class EvmOneTransitionTool(TransitionTool):
1919
"""Evmone `evmone-t8n` Transition tool interface wrapper class."""
2020

2121
default_binary = Path("evmone-t8n")
22-
detect_binary_pattern = compile(r"^evmone-t8n\b")
22+
detect_binary_pattern = re.compile(r"^evmone-t8n\b")
2323
t8n_use_stream = False
2424

2525
binary: Path

src/ethereum_clis/clis/execution_specs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
https://github.com/petertdavies/ethereum-spec-evm-resolver
55
"""
66

7+
import re
78
import subprocess
89
import time
910
from pathlib import Path
10-
from re import compile
1111
from tempfile import TemporaryDirectory
1212
from typing import Dict, List, Optional
1313

@@ -42,7 +42,7 @@ class ExecutionSpecsTransitionTool(TransitionTool):
4242
"""
4343

4444
default_binary = Path("ethereum-spec-evm-resolver")
45-
detect_binary_pattern = compile(r"^ethereum-spec-evm-resolver\b")
45+
detect_binary_pattern = re.compile(r"^ethereum-spec-evm-resolver\b")
4646
t8n_use_server: bool = True
4747
server_dir: Optional[TemporaryDirectory] = None
4848

src/ethereum_clis/clis/geth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Go-ethereum Transition tool interface."""
22

33
import json
4+
import re
45
import shutil
56
import subprocess
67
import textwrap
78
from pathlib import Path
8-
from re import compile
99
from typing import Optional
1010

1111
from ethereum_test_exceptions import (
@@ -24,7 +24,7 @@ class GethTransitionTool(TransitionTool):
2424
"""Go-ethereum `evm` Transition tool interface wrapper class."""
2525

2626
default_binary = Path("evm")
27-
detect_binary_pattern = compile(r"^evm(.exe)? version\b")
27+
detect_binary_pattern = re.compile(r"^evm(.exe)? version\b")
2828
t8n_subcommand: Optional[str] = "t8n"
2929
statetest_subcommand: Optional[str] = "statetest"
3030
blocktest_subcommand: Optional[str] = "blocktest"

src/ethereum_clis/clis/nimbus.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import re
44
import subprocess
55
from pathlib import Path
6-
from re import compile
76
from typing import Optional
87

98
from ethereum_test_exceptions import (
@@ -21,7 +20,7 @@ class NimbusTransitionTool(TransitionTool):
2120
"""Nimbus `evm` Transition tool interface wrapper class."""
2221

2322
default_binary = Path("t8n")
24-
detect_binary_pattern = compile(r"^Nimbus-t8n\b")
23+
detect_binary_pattern = re.compile(r"^Nimbus-t8n\b")
2524
version_flag: str = "--version"
2625

2726
binary: Path

src/ethereum_clis/transition_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
from typing import Any, Dict, List, Mapping, Optional, Type
1414
from urllib.parse import urlencode
1515

16+
import requests.exceptions
1617
from requests import Response
17-
from requests.exceptions import ConnectionError
1818
from requests_unixsocket import Session # type: ignore
1919

2020
from ethereum_test_exceptions import ExceptionMapper
@@ -268,7 +268,7 @@ def _server_post(
268268
timeout=20,
269269
)
270270
break
271-
except ConnectionError as e:
271+
except requests.exceptions.ConnectionError as e:
272272
retries -= 1
273273
if retries == 0:
274274
raise e

0 commit comments

Comments
 (0)