From fd38036b9f1693f8f368851d40928bc5922ce606 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 28 Jun 2012 16:38:03 +0200 Subject: remove workarounds for missing next() and hashlib --- test.py | 11 +---------- wsgitools/adapters.py | 6 ------ wsgitools/filters.py | 5 ----- wsgitools/middlewares.py | 5 ----- 4 files changed, 1 insertion(+), 26 deletions(-) diff --git a/test.py b/test.py index 1acf5aa..f46a512 100755 --- a/test.py +++ b/test.py @@ -9,18 +9,9 @@ try: import cStringIO as io except ImportError: import StringIO as io -try: - from hashlib import md5 -except ImportError: - from md5 import md5 +from hashlib import md5 import sys -try: - next -except NameError: - def next(iterator): - return iterator.next() - class Request: def __init__(self, case): """ diff --git a/wsgitools/adapters.py b/wsgitools/adapters.py index 6c6bbca..4c82200 100644 --- a/wsgitools/adapters.py +++ b/wsgitools/adapters.py @@ -9,12 +9,6 @@ __all__ = [] from wsgitools.filters import CloseableIterator, CloseableList -try: - next -except NameError: - def next(it): - return it.next() - __all__.append("WSGI2to1Adapter") class WSGI2to1Adapter: """Adapts an application with an interface that might somewhen be known as diff --git a/wsgitools/filters.py b/wsgitools/filters.py index 7ae1b69..4c7ff20 100644 --- a/wsgitools/filters.py +++ b/wsgitools/filters.py @@ -17,11 +17,6 @@ try: except ImportError: import StringIO as io -try: - next -except NameError: - def next(it): - return it.next() __all__.append("CloseableIterator") class CloseableIterator: diff --git a/wsgitools/middlewares.py b/wsgitools/middlewares.py index 804d474..dbf2020 100644 --- a/wsgitools/middlewares.py +++ b/wsgitools/middlewares.py @@ -11,11 +11,6 @@ try: import cStringIO as io except ImportError: import StringIO as io -try: - next -except NameError: - def next(iterator): - return iterator.next() if sys.version_info[0] >= 3: def exc_info_for_raise(exc_info): -- cgit v1.2.3