Tres Seaver
2016-05-31 2d1f2cf61df8f507f9ed605d28c63af6e2ddc85a
Remove import fossils.

- We no longer support any Python for which 'import hashlib' fails.

- Remove unused imports.
2 files modified
14 ■■■■ changed files
repoze/who/_auth_tkt.py 6 ●●●● patch | view | raw | blame | history
repoze/who/plugins/auth_tkt.py 8 ●●●● patch | view | raw | blame | history
repoze/who/_auth_tkt.py
@@ -36,12 +36,8 @@
makes it possible to use the same authentication process with
non-Python code run under Apache.
"""
import hashlib
import time as time_mod
try:
    import hashlib
except ImportError:
    # mimic hashlib (will work for md5, fail for secure hashes)
    import md5 as hashlib
from repoze.who._compat import encodestring
from repoze.who._compat import SimpleCookie
repoze/who/plugins/auth_tkt.py
@@ -1,14 +1,9 @@
import datetime
from calendar import timegm
from email.utils import formatdate
from codecs import utf_8_decode
from codecs import utf_8_encode
import hashlib
import os
import time
try:
    import hashlib
except ImportError:
    import md5 as hashlib # Will only support md5 algorithm
from wsgiref.handlers import _monthname     # Locale-independent, RFC-2616
from wsgiref.handlers import _weekdayname   # Locale-independent, RFC-2616
try:
@@ -24,7 +19,6 @@
from repoze.who._compat import get_cookies
import repoze.who._auth_tkt as auth_tkt
from repoze.who._compat import STRING_TYPES
from repoze.who._compat import u
_UTCNOW = None  # unit tests can replace
def _utcnow():  #pragma NO COVERAGE