view mercurial/pycompat.py @ 28820:9848a6c77a9b

check-code: reject import Queue, suggest util.queue class for py3 compat
author timeless <timeless@mozdev.org>
date Wed, 06 Apr 2016 20:08:18 +0000
parents 6041fb8f2da8
children 672fc23bf9cc
line wrap: on
line source

# pycompat.py - portability shim for python 3
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

"""Mercurial portability shim for python 3.

This contains aliases to hide python version-specific details from the core.
"""

from __future__ import absolute_import

try:
    import Queue as _queue
except ImportError:
    import queue as _queue
empty = _queue.Empty
queue = _queue.Queue