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
--- 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):