[Updated] D11732: compat: don't rely on cpython-specific builtins manipulation

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Wed Nov 3 16:31:11 UTC 2021


Closed by commit rHG6ffcaba7d122: compat: don't rely on cpython-specific builtins manipulation (authored by Alphare).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11732?vs=31012&id=31017

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11732/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11732

AFFECTED FILES
  mercurial/pycompat.py

CHANGE DETAILS

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -44,6 +44,7 @@
     FileNotFoundError = OSError
 
 else:
+    import builtins
     import concurrent.futures as futures
     import http.cookiejar as cookielib
     import http.client as httplib
@@ -55,7 +56,7 @@
     def future_set_exception_info(f, exc_info):
         f.set_exception(exc_info[0])
 
-    FileNotFoundError = __builtins__['FileNotFoundError']
+    FileNotFoundError = builtins.FileNotFoundError
 
 
 def identity(a):



To: Alphare, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211103/c7f2eadc/attachment-0002.html>


More information about the Mercurial-patches mailing list