contrib/perf.py
changeset 37844 8fb9985382be
parent 37355 5bcd5859b505
child 38253 1b121cc680f2
--- a/contrib/perf.py	Sat May 05 18:41:51 2018 -0700
+++ b/contrib/perf.py	Sat May 05 18:35:16 2018 -0700
@@ -71,6 +71,16 @@
     import inspect
     getargspec = inspect.getargspec
 
+try:
+    # 4.7+
+    queue = pycompat.queue.Queue
+except (AttributeError, ImportError):
+    # <4.7.
+    try:
+        queue = pycompat.queue
+    except (AttributeError, ImportError):
+        queue = util.queue
+
 # for "historical portability":
 # define util.safehasattr forcibly, because util.safehasattr has been
 # available since 1.9.3 (or 94b200a11cf7)
@@ -1029,7 +1039,7 @@
                 else:
                     mdiff.textdiff(*pair)
     else:
-        q = util.queue()
+        q = queue()
         for i in xrange(threads):
             q.put(None)
         ready = threading.Condition()