Quellcode durchsuchen

Add missing type hints to InsecureInterceptableContextFactory. (#15164)

tags/v1.79.0rc1
Patrick Cloke vor 1 Jahr
committed by GitHub
Ursprung
Commit
c369d82df0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 4 neuen und 5 gelöschten Zeilen
  1. +1
    -0
      changelog.d/15164.misc
  2. +0
    -3
      mypy.ini
  3. +3
    -2
      synapse/http/client.py

+ 1
- 0
changelog.d/15164.misc Datei anzeigen

@@ -0,0 +1 @@
Improve type hints.

+ 0
- 3
mypy.ini Datei anzeigen

@@ -36,9 +36,6 @@ exclude = (?x)
[mypy-synapse.federation.transport.client]
disallow_untyped_defs = False

[mypy-synapse.http.client]
disallow_untyped_defs = False

[mypy-synapse.http.matrixfederationclient]
disallow_untyped_defs = False



+ 3
- 2
synapse/http/client.py Datei anzeigen

@@ -44,6 +44,7 @@ from twisted.internet.interfaces import (
IAddress,
IDelayedCall,
IHostResolution,
IOpenSSLContextFactory,
IReactorCore,
IReactorPluggableNameResolver,
IReactorTime,
@@ -958,8 +959,8 @@ class InsecureInterceptableContextFactory(ssl.ContextFactory):
self._context = SSL.Context(SSL.SSLv23_METHOD)
self._context.set_verify(VERIFY_NONE, lambda *_: False)

def getContext(self, hostname=None, port=None):
def getContext(self) -> SSL.Context:
return self._context

def creatorForNetloc(self, hostname: bytes, port: int):
def creatorForNetloc(self, hostname: bytes, port: int) -> IOpenSSLContextFactory:
return self

Laden…
Abbrechen
Speichern