mercurial/pycompat.py
changeset 49802 f3f33980f19b
parent 49801 9cd327509cd4
child 49803 55d45d0de4e7
--- a/mercurial/pycompat.py	Wed Dec 14 01:32:03 2022 -0500
+++ b/mercurial/pycompat.py	Wed Dec 14 01:38:52 2022 -0500
@@ -128,7 +128,7 @@
 
 long = int
 
-if getattr(sys, 'argv', None) is not None:
+if builtins.getattr(sys, 'argv', None) is not None:
     # On POSIX, the char** argv array is converted to Python str using
     # Py_DecodeLocale(). The inverse of this is Py_EncodeLocale(), which
     # isn't directly callable from Python code. In practice, os.fsencode()
@@ -220,7 +220,7 @@
             return s
         if not isinstance(
             s, (bytes, bytearray)
-        ) and not hasattr(  # hasattr-py3-only
+        ) and not builtins.hasattr(  # hasattr-py3-only
             s, u'__bytes__'
         ):
             s = str(s).encode('ascii')
@@ -297,7 +297,7 @@
 def getdoc(obj):
     """Get docstring as bytes; may be None so gettext() won't confuse it
     with _('')"""
-    doc = getattr(obj, '__doc__', None)
+    doc = builtins.getattr(obj, '__doc__', None)
     if doc is None:
         return doc
     return sysbytes(doc)