Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/pycompat.py @ 28818:6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
While the pycompat module will actually handle divergence, please
access these properties from the util module:
util.queue = Queue.Queue / queue.Queue
util.empty = Queue.Empty / queue.Empty
author | timeless <timeless@mozdev.org> |
---|---|
date | Wed, 06 Apr 2016 20:00:49 +0000 |
parents | |
children | 672fc23bf9cc |
comparison
equal
deleted
inserted
replaced
28817:e1d26630443d | 28818:6041fb8f2da8 |
---|---|
1 # pycompat.py - portability shim for python 3 | |
2 # | |
3 # This software may be used and distributed according to the terms of the | |
4 # GNU General Public License version 2 or any later version. | |
5 | |
6 """Mercurial portability shim for python 3. | |
7 | |
8 This contains aliases to hide python version-specific details from the core. | |
9 """ | |
10 | |
11 from __future__ import absolute_import | |
12 | |
13 try: | |
14 import Queue as _queue | |
15 except ImportError: | |
16 import queue as _queue | |
17 empty = _queue.Empty | |
18 queue = _queue.Queue |