summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/72.bugfix1
-rw-r--r--synapse/handlers/auth.py8
-rw-r--r--synapse/python_dependencies.py2
-rw-r--r--tox.ini5
4 files changed, 9 insertions, 7 deletions
diff --git a/changelog.d/72.bugfix b/changelog.d/72.bugfix
new file mode 100644
index 0000000000..7ebd16f437
--- /dev/null
+++ b/changelog.d/72.bugfix
@@ -0,0 +1 @@
+Update the version of mypy to 0.790.
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py
index 00eae92052..8770e43635 100644
--- a/synapse/handlers/auth.py
+++ b/synapse/handlers/auth.py
@@ -1115,20 +1115,22 @@ class AuthHandler(BaseHandler):
             Whether self.hash(password) == stored_hash.
         """
 
-        def _do_validate_hash():
+        def _do_validate_hash(checked_hash: bytes):
             # Normalise the Unicode in the password
             pw = unicodedata.normalize("NFKC", password)
 
             return bcrypt.checkpw(
                 pw.encode("utf8") + self.hs.config.password_pepper.encode("utf8"),
-                stored_hash,
+                checked_hash,
             )
 
         if stored_hash:
             if not isinstance(stored_hash, bytes):
                 stored_hash = stored_hash.encode("ascii")
 
-            return await defer_to_thread(self.hs.get_reactor(), _do_validate_hash)
+            return await defer_to_thread(
+                self.hs.get_reactor(), _do_validate_hash, stored_hash
+            )
         else:
             return False
 
diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py
index 0ddead8a0f..3e188cd4d6 100644
--- a/synapse/python_dependencies.py
+++ b/synapse/python_dependencies.py
@@ -107,6 +107,8 @@ CONDITIONAL_REQUIREMENTS = {
     "redis": ["txredisapi>=1.4.7", "hiredis"],
 }
 
+CONDITIONAL_REQUIREMENTS["mypy"] = ["mypy==0.790", "mypy-zope==0.2.8"]
+
 ALL_OPTIONAL_REQUIREMENTS = set()  # type: Set[str]
 
 for name, optional_deps in CONDITIONAL_REQUIREMENTS.items():
diff --git a/tox.ini b/tox.ini
index 0a2d14aec4..300417287a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -159,12 +159,9 @@ commands=
     coverage html
 
 [testenv:mypy]
-skip_install = True
 deps =
     {[base]deps}
-    mypy==0.782
-    mypy-zope
-extras = all
+extras = all, mypy
 commands = mypy
 
 # To find all folders that pass mypy you run: