##// END OF EJS Templates
pycompat: fix demand import handling of Queue...
pycompat: fix demand import handling of Queue When demandimport is enabled, simply importing a non existent module does not trigger ImportError, a property access is necessary.

File last commit:

r28833:672fc23b default
r28833:672fc23b default
Show More
pycompat.py
19 lines | 489 B | text/x-python | PythonLexer
# 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
_queue.Queue
except ImportError:
import queue as _queue
empty = _queue.Empty
queue = _queue.Queue