From 2d1f2cf61df8f507f9ed605d28c63af6e2ddc85a Mon Sep 17 00:00:00 2001 From: Tres Seaver <tseaver@palladion.com> Date: Tue, 31 May 2016 18:35:27 +0200 Subject: [PATCH] Remove import fossils. --- repoze/who/_auth_tkt.py | 6 +----- repoze/who/plugins/auth_tkt.py | 8 +------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/repoze/who/_auth_tkt.py b/repoze/who/_auth_tkt.py index 8e7d0df..b088064 100644 --- a/repoze/who/_auth_tkt.py +++ b/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 diff --git a/repoze/who/plugins/auth_tkt.py b/repoze/who/plugins/auth_tkt.py index db74da5..fa9e552 100644 --- a/repoze/who/plugins/auth_tkt.py +++ b/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 -- Gitblit v1.9.3