changeset 48298:6ffcaba7d122

compat: don't rely on cpython-specific builtins manipulation Pierre Augier signaled on the mailing list that this fails on Pypy and pointed out the correct solution. Differential Revision: https://phab.mercurial-scm.org/D11732
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 03 Nov 2021 12:35:57 +0100
parents 9ebc10ad4a04
children 1a420a13eeea
files mercurial/pycompat.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/pycompat.py	Wed Nov 03 17:06:01 2021 +0100
+++ b/mercurial/pycompat.py	Wed Nov 03 12:35:57 2021 +0100
@@ -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):