# HG changeset patch # User timeless # Date 2016-04-06 20:07:51 # Node ID 826d457df138096df9e450b91665bc14681b7210 # Parent 6041fb8f2da881a323e7068bc156be524fe7d65a scmutil: use util.queue/util.empty for py3 compat diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -7,7 +7,6 @@ from __future__ import absolute_import -import Queue import contextlib import errno import glob @@ -1320,7 +1319,7 @@ class backgroundfilecloser(object): 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 @@ class backgroundfilecloser(object): 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 diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t +++ b/tests/test-check-py3-compat.t @@ -137,11 +137,11 @@ hgext/win*text.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) mercurial/archival.py: invalid syntax: invalid syntax (, line *) (glob) mercurial/bookmarks.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) - mercurial/branchmap.py: error importing: No module named 'Queue' (error at scmutil.py:*) (glob) + mercurial/branchmap.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) mercurial/bundle*.py: invalid syntax: invalid syntax (, line *) (glob) mercurial/bundlerepo.py: error importing module: invalid syntax (bundle*.py, line *) (line *) (glob) mercurial/byterange.py: error importing module: No module named 'urllib2' (line *) (glob) - mercurial/changegroup.py: error importing: No module named 'Queue' (error at scmutil.py:*) (glob) + mercurial/changegroup.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) mercurial/changelog.py: error importing: No module named 'cStringIO' (error at mpatch.py:*) (glob) mercurial/cmdutil.py: error importing module: No module named 'cStringIO' (line *) (glob) mercurial/commands.py: invalid syntax: invalid syntax (, line *) (glob) @@ -199,7 +199,7 @@ mercurial/repoview.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) mercurial/revlog.py: error importing: No module named 'cStringIO' (error at mpatch.py:*) (glob) mercurial/revset.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) - mercurial/scmutil.py: error importing module: No module named 'Queue' (line *) (glob) + mercurial/scmutil.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) mercurial/scmwindows.py: error importing module: No module named '_winreg' (line *) (glob) mercurial/similar.py: error importing: No module named 'cStringIO' (error at mpatch.py:*) (glob) mercurial/simplemerge.py: error importing: No module named 'cStringIO' (error at mpatch.py:*) (glob) @@ -208,7 +208,7 @@ mercurial/sslutil.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) mercurial/statichttprepo.py: error importing module: No module named 'urllib2' (line *) (glob) mercurial/store.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) - mercurial/streamclone.py: error importing: No module named 'Queue' (error at scmutil.py:*) (glob) + mercurial/streamclone.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) mercurial/subrepo.py: error importing: No module named 'cStringIO' (error at cmdutil.py:*) (glob) mercurial/tagmerge.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob) mercurial/tags.py: error importing: No module named 'cStringIO' (error at parsers.py:*) (glob)