Skip to content

Commit 15d7c48

Browse files
committed
PYTHON-5040 Fix mypy typing errors in synchro.py and gen-certs.py
Use bare type: ignore in synchro.py so it suppresses whichever import error mypy raises depending on whether unasync is installed. Add arg-type ignore in gen-certs.py for a cryptography stubs version skew.
1 parent 5416301 commit 15d7c48

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

test/certificates/gen-certs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def aki_from_ca(ca_cert: x509.Certificate) -> x509.AuthorityKeyIdentifier:
7777
# keyid form: SHA-1 hash of the CA's public key. Required by Python 3.14 /
7878
# OpenSSL 3.x strict chain building. macOS OCSP enforcement on the server
7979
# side is bypassed via --tlsAllowInvalidCertificates, so keyid form is safe.
80-
return x509.AuthorityKeyIdentifier.from_issuer_public_key(ca_cert.public_key())
80+
return x509.AuthorityKeyIdentifier.from_issuer_public_key(ca_cert.public_key()) # type: ignore[arg-type]
8181

8282

8383
def server_san() -> x509.SubjectAlternativeName:

tools/synchro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from os import listdir
2626
from pathlib import Path
2727

28-
from unasync import Rule, unasync_files # type: ignore[import-not-found]
28+
from unasync import Rule, unasync_files # type: ignore
2929

3030
replacements = {
3131
"AsyncCollection": "Collection",

0 commit comments

Comments
 (0)