Skip to content

Commit 3a990a8

Browse files
gijzelaerrclaude
andcommitted
Fix ruff formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 48ce815 commit 3a990a8

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

snap7/s7commplus/async_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ async def connect(
179179
if not self._tls_active:
180180
from ..error import S7ConnectionError
181181

182-
raise S7ConnectionError(
183-
"PLC reports V2 protocol but TLS is not active. V2 requires TLS. Use use_tls=True."
184-
)
182+
raise S7ConnectionError("PLC reports V2 protocol but TLS is not active. V2 requires TLS. Use use_tls=True.")
185183
# Enable IntegrityId tracking for V2+
186184
self._with_integrity_id = True
187185
self._integrity_id_read = 0

tests/test_async_tls.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ def _generate_self_signed_cert() -> tuple[str, str]:
3232
pytest.skip("cryptography package required for TLS tests")
3333

3434
key = rsa.generate_private_key(public_exponent=65537, key_size=2048)
35-
subject = issuer = x509.Name([
36-
x509.NameAttribute(NameOID.COMMON_NAME, "localhost"),
37-
])
35+
subject = issuer = x509.Name(
36+
[
37+
x509.NameAttribute(NameOID.COMMON_NAME, "localhost"),
38+
]
39+
)
3840
cert = (
3941
x509.CertificateBuilder()
4042
.subject_name(subject)
@@ -55,11 +57,13 @@ def _generate_self_signed_cert() -> tuple[str, str]:
5557
cert_file.close()
5658

5759
key_file = tempfile.NamedTemporaryFile(suffix=".pem", delete=False)
58-
key_file.write(key.private_bytes(
59-
serialization.Encoding.PEM,
60-
serialization.PrivateFormat.TraditionalOpenSSL,
61-
serialization.NoEncryption(),
62-
))
60+
key_file.write(
61+
key.private_bytes(
62+
serialization.Encoding.PEM,
63+
serialization.PrivateFormat.TraditionalOpenSSL,
64+
serialization.NoEncryption(),
65+
)
66+
)
6367
key_file.close()
6468

6569
return cert_file.name, key_file.name

0 commit comments

Comments
 (0)