##// END OF EJS Templates
pycompat: explicitly prefix builtin attr usage with `builtins.`...
Matt Harbison -
r50697:f3f33980 default
parent child Browse files
Show More
@@ -128,7 +128,7 b' getargspec = inspect.getfullargspec'
128
128
129 long = int
129 long = int
130
130
131 if getattr(sys, 'argv', None) is not None:
131 if builtins.getattr(sys, 'argv', None) is not None:
132 # On POSIX, the char** argv array is converted to Python str using
132 # On POSIX, the char** argv array is converted to Python str using
133 # Py_DecodeLocale(). The inverse of this is Py_EncodeLocale(), which
133 # Py_DecodeLocale(). The inverse of this is Py_EncodeLocale(), which
134 # isn't directly callable from Python code. In practice, os.fsencode()
134 # isn't directly callable from Python code. In practice, os.fsencode()
@@ -220,7 +220,7 b' class bytestr(bytes):'
220 return s
220 return s
221 if not isinstance(
221 if not isinstance(
222 s, (bytes, bytearray)
222 s, (bytes, bytearray)
223 ) and not hasattr( # hasattr-py3-only
223 ) and not builtins.hasattr( # hasattr-py3-only
224 s, u'__bytes__'
224 s, u'__bytes__'
225 ):
225 ):
226 s = str(s).encode('ascii')
226 s = str(s).encode('ascii')
@@ -297,7 +297,7 b' def raisewithtb(exc, tb):'
297 def getdoc(obj):
297 def getdoc(obj):
298 """Get docstring as bytes; may be None so gettext() won't confuse it
298 """Get docstring as bytes; may be None so gettext() won't confuse it
299 with _('')"""
299 with _('')"""
300 doc = getattr(obj, '__doc__', None)
300 doc = builtins.getattr(obj, '__doc__', None)
301 if doc is None:
301 if doc is None:
302 return doc
302 return doc
303 return sysbytes(doc)
303 return sysbytes(doc)
General Comments 0
You need to be logged in to leave comments. Login now