Show More
@@ -1,19 +1,25 b'' | |||||
1 | # pycompat.py - portability shim for python 3 |
|
1 | # pycompat.py - portability shim for python 3 | |
2 | # |
|
2 | # | |
3 | # This software may be used and distributed according to the terms of the |
|
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. |
|
4 | # GNU General Public License version 2 or any later version. | |
5 |
|
5 | |||
6 | """Mercurial portability shim for python 3. |
|
6 | """Mercurial portability shim for python 3. | |
7 |
|
7 | |||
8 | This contains aliases to hide python version-specific details from the core. |
|
8 | This contains aliases to hide python version-specific details from the core. | |
9 | """ |
|
9 | """ | |
10 |
|
10 | |||
11 | from __future__ import absolute_import |
|
11 | from __future__ import absolute_import | |
12 |
|
12 | |||
13 | try: |
|
13 | try: | |
14 | import Queue as _queue |
|
14 | import Queue as _queue | |
15 | _queue.Queue |
|
15 | _queue.Queue | |
16 | except ImportError: |
|
16 | except ImportError: | |
17 | import queue as _queue |
|
17 | import queue as _queue | |
18 | empty = _queue.Empty |
|
18 | empty = _queue.Empty | |
19 | queue = _queue.Queue |
|
19 | queue = _queue.Queue | |
|
20 | ||||
|
21 | try: | |||
|
22 | xrange | |||
|
23 | except NameError: | |||
|
24 | import builtins | |||
|
25 | builtins.xrange = range |
General Comments 0
You need to be logged in to leave comments.
Login now