Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit c369d82

Browse files
authored
Add missing type hints to InsecureInterceptableContextFactory. (#15164)
1 parent e746f80 commit c369d82

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

changelog.d/15164.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve type hints.

mypy.ini

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ exclude = (?x)
3636
[mypy-synapse.federation.transport.client]
3737
disallow_untyped_defs = False
3838

39-
[mypy-synapse.http.client]
40-
disallow_untyped_defs = False
41-
4239
[mypy-synapse.http.matrixfederationclient]
4340
disallow_untyped_defs = False
4441

synapse/http/client.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
IAddress,
4545
IDelayedCall,
4646
IHostResolution,
47+
IOpenSSLContextFactory,
4748
IReactorCore,
4849
IReactorPluggableNameResolver,
4950
IReactorTime,
@@ -958,8 +959,8 @@ def __init__(self) -> None:
958959
self._context = SSL.Context(SSL.SSLv23_METHOD)
959960
self._context.set_verify(VERIFY_NONE, lambda *_: False)
960961

961-
def getContext(self, hostname=None, port=None):
962+
def getContext(self) -> SSL.Context:
962963
return self._context
963964

964-
def creatorForNetloc(self, hostname: bytes, port: int):
965+
def creatorForNetloc(self, hostname: bytes, port: int) -> IOpenSSLContextFactory:
965966
return self

0 commit comments

Comments
 (0)