Skip to content
Snippets Groups Projects
Unverified Commit 52384f2e authored by Amber Brown's avatar Amber Brown Committed by GitHub
Browse files

Merge pull request #3626 from krombel/only_import_secrets_when_available

Only import secrets when available
parents e9b2d047 254e8267
No related branches found
No related tags found
No related merge requests found
Only import secrets when available (fix for py < 3.6)
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment