# HG changeset patch # User Yuya Nishihara # Date 2016-10-20 15:09:38 # Node ID 00c9ac4ce8163704e25e04be8bef68c21bfab8c3 # Parent 10d15095d7c27f8cead0542f0a816b27c5122da0 util: rewrite pycompat imports to make pyflakes always happy I'll add more imports which would confuse pyflakes. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -48,25 +48,17 @@ from . import ( pycompat, ) -for attr in ( - 'empty', - 'httplib', - 'httpserver', - 'pickle', - 'queue', - 'urlerr', - 'urlparse', - # we do import urlreq, but we do it outside the loop - #'urlreq', - 'stringio', - 'socketserver', - 'xmlrpclib', -): - a = pycompat.sysstr(attr) - globals()[a] = getattr(pycompat, a) - -# This line is to make pyflakes happy: +empty = pycompat.empty +httplib = pycompat.httplib +httpserver = pycompat.httpserver +pickle = pycompat.pickle +queue = pycompat.queue +socketserver = pycompat.socketserver +stringio = pycompat.stringio +urlerr = pycompat.urlerr +urlparse = pycompat.urlparse urlreq = pycompat.urlreq +xmlrpclib = pycompat.xmlrpclib if os.name == 'nt': from . import windows as platform