diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-11-02 06:30:07 -0700 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2018-11-03 03:21:49 -0700 |
commit | 3f1e817f24b4b51c1d1f17a7c1ef5a3bc5746751 (patch) | |
tree | 22d8069a7fc3be2cf94db2ff961a1a8c581017ab /redis/_compat.py | |
parent | a64c2cbf10ce895f34a961e4d25667294c3e97c3 (diff) | |
download | redis-py-3f1e817f24b4b51c1d1f17a7c1ef5a3bc5746751.tar.gz |
Remove Queue package workarounds for older unsupported Pythons
Diffstat (limited to 'redis/_compat.py')
-rw-r--r-- | redis/_compat.py | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/redis/_compat.py b/redis/_compat.py index de856f3..ad12543 100644 --- a/redis/_compat.py +++ b/redis/_compat.py @@ -171,27 +171,5 @@ else: try: # Python 3 from queue import LifoQueue, Empty, Full -except ImportError: - from Queue import Empty, Full - try: # Python 2.6 - 2.7 - from Queue import LifoQueue - except ImportError: # Python 2.5 - from Queue import Queue - # From the Python 2.7 lib. Python 2.5 already extracted the core - # methods to aid implementating different queue organisations. - - class LifoQueue(Queue): - "Override queue methods to implement a last-in first-out queue." - - def _init(self, maxsize): - self.maxsize = maxsize - self.queue = [] - - def _qsize(self, len=len): - return len(self.queue) - - def _put(self, item): - self.queue.append(item) - - def _get(self): - return self.queue.pop() +except ImportError: # Python 2 + from Queue import LifoQueue, Empty, Full |