Fix type errors and linting issues

- Fix type annotation errors in transport_registry.py and __init__.py
- Fix line length violations in test files (E501 errors)
- Fix missing return type annotations
- Fix cryptography NameAttribute type errors with type: ignore
- Fix ExceptionGroup import for cross-version compatibility
- Fix test failure in test_wss_listen_without_tls_config by handling ExceptionGroup
- Fix len() calls with None arguments in test_tcp_data_transfer.py
- Fix missing attribute access errors on interface types
- Fix boolean type expectation errors in test_js_ws_ping.py
- Fix nursery context manager type errors

All tests now pass and linting is clean.
This commit is contained in:
acul71
2025-09-08 04:18:10 +02:00
parent afe6da5db2
commit f4d5a44521
15 changed files with 1028 additions and 531 deletions

View File

@ -125,7 +125,7 @@ def is_valid_websocket_multiaddr(maddr: Multiaddr) -> bool:
# Find the WebSocket protocol
ws_protocol_found = False
tls_found = False
sni_found = False
# sni_found = False # Not used currently
for i, protocol in enumerate(protocols[2:], start=2):
if protocol.name in ws_protocols:
@ -134,7 +134,7 @@ def is_valid_websocket_multiaddr(maddr: Multiaddr) -> bool:
elif protocol.name in tls_protocols:
tls_found = True
elif protocol.name in sni_protocols:
# sni_found = True # Not used in current implementation
pass # sni_found = True # Not used in current implementation
if not ws_protocol_found:
return False