##// END OF EJS Templates
check-code: ignore re-exports of os.environ in encoding.py...
Yuya Nishihara -
r32185:cf424dae default
parent child Browse files
Show More
@@ -474,7 +474,7 b' allfilespats = ['
474
474
475 py3pats = [
475 py3pats = [
476 [
476 [
477 (r'os\.environ', "use encoding.environ instead (py3)"),
477 (r'os\.environ', "use encoding.environ instead (py3)", r'#.*re-exports'),
478 (r'os\.name', "use pycompat.osname instead (py3)"),
478 (r'os\.name', "use pycompat.osname instead (py3)"),
479 (r'os\.getcwd', "use pycompat.getcwd instead (py3)"),
479 (r'os\.getcwd', "use pycompat.getcwd instead (py3)"),
480 (r'os\.sep', "use pycompat.ossep instead (py3)"),
480 (r'os\.sep', "use pycompat.ossep instead (py3)"),
@@ -51,14 +51,14 b' def hfsignoreclean(s):'
51 # the process environment
51 # the process environment
52 _nativeenviron = (not pycompat.ispy3 or os.supports_bytes_environ)
52 _nativeenviron = (not pycompat.ispy3 or os.supports_bytes_environ)
53 if not pycompat.ispy3:
53 if not pycompat.ispy3:
54 environ = os.environ
54 environ = os.environ # re-exports
55 elif _nativeenviron:
55 elif _nativeenviron:
56 environ = os.environb
56 environ = os.environb # re-exports
57 else:
57 else:
58 # preferred encoding isn't known yet; use utf-8 to avoid unicode error
58 # preferred encoding isn't known yet; use utf-8 to avoid unicode error
59 # and recreate it once encoding is settled
59 # and recreate it once encoding is settled
60 environ = dict((k.encode(u'utf-8'), v.encode(u'utf-8'))
60 environ = dict((k.encode(u'utf-8'), v.encode(u'utf-8'))
61 for k, v in os.environ.items())
61 for k, v in os.environ.items()) # re-exports
62
62
63 def _getpreferredencoding():
63 def _getpreferredencoding():
64 '''
64 '''
@@ -218,7 +218,7 b' if not _nativeenviron:'
218 # now encoding and helper functions are available, recreate the environ
218 # now encoding and helper functions are available, recreate the environ
219 # dict to be exported to other modules
219 # dict to be exported to other modules
220 environ = dict((tolocal(k.encode(u'utf-8')), tolocal(v.encode(u'utf-8')))
220 environ = dict((tolocal(k.encode(u'utf-8')), tolocal(v.encode(u'utf-8')))
221 for k, v in os.environ.items())
221 for k, v in os.environ.items()) # re-exports
222
222
223 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide.
223 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide.
224 wide = (environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"
224 wide = (environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"
@@ -13,18 +13,6 b' New errors are not allowed. Warnings are'
13 > r.revision(r.node(x))
13 > r.revision(r.node(x))
14 don't convert rev to node before passing to revision(nodeorrev)
14 don't convert rev to node before passing to revision(nodeorrev)
15 Skipping i18n/polib.py it has no-che?k-code (glob)
15 Skipping i18n/polib.py it has no-che?k-code (glob)
16 mercurial/encoding.py:54:
17 > environ = os.environ
18 use encoding.environ instead (py3)
19 mercurial/encoding.py:56:
20 > environ = os.environb
21 use encoding.environ instead (py3)
22 mercurial/encoding.py:61:
23 > for k, v in os.environ.items())
24 use encoding.environ instead (py3)
25 mercurial/encoding.py:221:
26 > for k, v in os.environ.items())
27 use encoding.environ instead (py3)
28 Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob)
16 Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob)
29 Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob)
17 Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob)
30 Skipping mercurial/statprof.py it has no-che?k-code (glob)
18 Skipping mercurial/statprof.py it has no-che?k-code (glob)
General Comments 0
You need to be logged in to leave comments. Login now