scmutil: use util.queue/util.empty for py3 compat
authortimeless <timeless@mozdev.org>
Wed, 06 Apr 2016 20:07:51 +0000
changeset 28819 826d457df138
parent 28818 6041fb8f2da8
child 28820 9848a6c77a9b
scmutil: use util.queue/util.empty for py3 compat
mercurial/scmutil.py
tests/test-check-py3-compat.t
--- a/mercurial/scmutil.py	Wed Apr 06 20:00:49 2016 +0000
+++ b/mercurial/scmutil.py	Wed Apr 06 20:07:51 2016 +0000
@@ -7,7 +7,6 @@
 
 from __future__ import absolute_import
 
-import Queue
 import contextlib
 import errno
 import glob
@@ -1320,7 +1319,7 @@
         ui.debug('starting %d threads for background file closing\n' %
                  threadcount)
 
-        self._queue = Queue.Queue(maxsize=maxqueue)
+        self._queue = util.queue(maxsize=maxqueue)
         self._running = True
 
         for i in range(threadcount):
@@ -1352,7 +1351,7 @@
                 except Exception as e:
                     # Stash so can re-raise from main thread later.
                     self._threadexception = e
-            except Queue.Empty:
+            except util.empty:
                 if not self._running:
                     break
 
--- a/tests/test-check-py3-compat.t	Wed Apr 06 20:00:49 2016 +0000
+++ b/tests/test-check-py3-compat.t	Wed Apr 06 20:07:51 2016 +0000
@@ -137,11 +137,11 @@
   hgext/win*text.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
   mercurial/archival.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   mercurial/bookmarks.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
-  mercurial/branchmap.py: error importing: <ImportError> No module named 'Queue' (error at scmutil.py:*) (glob)
+  mercurial/branchmap.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
   mercurial/bundle*.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   mercurial/bundlerepo.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
   mercurial/byterange.py: error importing module: <ImportError> No module named 'urllib2' (line *) (glob)
-  mercurial/changegroup.py: error importing: <ImportError> No module named 'Queue' (error at scmutil.py:*) (glob)
+  mercurial/changegroup.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
   mercurial/changelog.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:*) (glob)
   mercurial/cmdutil.py: error importing module: <ImportError> No module named 'cStringIO' (line *) (glob)
   mercurial/commands.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
@@ -199,7 +199,7 @@
   mercurial/repoview.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
   mercurial/revlog.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:*) (glob)
   mercurial/revset.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
-  mercurial/scmutil.py: error importing module: <ImportError> No module named 'Queue' (line *) (glob)
+  mercurial/scmutil.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
   mercurial/scmwindows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
   mercurial/similar.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:*) (glob)
   mercurial/simplemerge.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:*) (glob)
@@ -208,7 +208,7 @@
   mercurial/sslutil.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
   mercurial/statichttprepo.py: error importing module: <ImportError> No module named 'urllib2' (line *) (glob)
   mercurial/store.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
-  mercurial/streamclone.py: error importing: <ImportError> No module named 'Queue' (error at scmutil.py:*) (glob)
+  mercurial/streamclone.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
   mercurial/subrepo.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:*) (glob)
   mercurial/tagmerge.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)
   mercurial/tags.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:*) (glob)