summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-07-31 08:58:24 +1000
committerGitHub <noreply@github.com>2018-07-31 08:58:24 +1000
commit52384f2ee5e810a145486e0180febdd7b3d89a7b (patch)
tree5b889ca649db2b36925d178c7f40adc6c34172bf /synapse
parentmake /context lazyload & filter aware (#3567) (diff)
parentOnly import secrets when available (diff)
downloadsynapse-52384f2ee5e810a145486e0180febdd7b3d89a7b.tar.xz
Merge pull request #3626 from krombel/only_import_secrets_when_available
Only import secrets when available
Diffstat (limited to 'synapse')
-rw-r--r--synapse/secrets.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/secrets.py b/synapse/secrets.py
index f397daaa5e..f05e9ea535 100644
--- a/synapse/secrets.py
+++ b/synapse/secrets.py
@@ -20,17 +20,16 @@ See https://docs.python.org/3/library/secrets.html#module-secrets for the API
 used in Python 3.6, and the API emulated in Python 2.7.
 """
 
-import six
+import sys
 
-if six.PY3:
+# secrets is available since python 3.6
+if sys.version_info[0:2] >= (3, 6):
     import secrets
 
     def Secrets():
         return secrets
 
-
 else:
-
     import os
     import binascii