##// END OF EJS Templates
pycompat: add empty and queue to handle py3 divergence...
timeless -
r28818:6041fb8f default
parent child Browse files
Show More
@@ -0,0 +1,18 b''
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
@@ -43,8 +43,15 b' from . import ('
43 i18n,
43 i18n,
44 osutil,
44 osutil,
45 parsers,
45 parsers,
46 pycompat,
46 )
47 )
47
48
49 for attr in (
50 'empty',
51 'queue',
52 ):
53 globals()[attr] = getattr(pycompat, attr)
54
48 if os.name == 'nt':
55 if os.name == 'nt':
49 from . import windows as platform
56 from . import windows as platform
50 else:
57 else:
General Comments 0
You need to be logged in to leave comments. Login now