author | timeless <timeless@mozdev.org> |
Fri, 08 Apr 2016 16:05:52 +0000 | |
changeset 28827 | 1e184241de51 |
parent 28818 | 6041fb8f2da8 |
child 28833 | 672fc23bf9cc |
permissions | -rw-r--r-- |
28818
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
1 |
# pycompat.py - portability shim for python 3 |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
2 |
# |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
3 |
# This software may be used and distributed according to the terms of the |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
4 |
# GNU General Public License version 2 or any later version. |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
5 |
|
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
6 |
"""Mercurial portability shim for python 3. |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
7 |
|
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
8 |
This contains aliases to hide python version-specific details from the core. |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
9 |
""" |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
10 |
|
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
11 |
from __future__ import absolute_import |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
12 |
|
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
13 |
try: |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
14 |
import Queue as _queue |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
15 |
except ImportError: |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
16 |
import queue as _queue |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
17 |
empty = _queue.Empty |
6041fb8f2da8
pycompat: add empty and queue to handle py3 divergence
timeless <timeless@mozdev.org>
parents:
diff
changeset
|
18 |
queue = _queue.Queue |