[PATCH 2 of 7] pycompat: fix demand import handling of Queue

timeless timeless at mozdev.org
Fri Apr 8 12:22:46 EDT 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1460124185 0
#      Fri Apr 08 14:03:05 2016 +0000
# Node ID 295d79e7d8dd3da8e9ce33611916574d7ddc0ad8
# Parent  b4f3a8a501aa6134f5ef33fd5281cc731e18c0ad
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.

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -12,6 +12,7 @@
 
 try:
     import Queue as _queue
+    _queue.Queue
 except ImportError:
     import queue as _queue
 empty = _queue.Empty


More information about the Mercurial-devel mailing list