# HG changeset patch # User Raphaël Gomès # Date 2021-11-03 11:35:57 # Node ID 6ffcaba7d1223a4ba7aff8befe2e7acaa8126ce1 # Parent 9ebc10ad4a0483c182511ec23cd236e169c74770 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 diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -44,6 +44,7 @@ if not ispy3: FileNotFoundError = OSError else: + import builtins import concurrent.futures as futures import http.cookiejar as cookielib import http.client as httplib @@ -55,7 +56,7 @@ else: def future_set_exception_info(f, exc_info): f.set_exception(exc_info[0]) - FileNotFoundError = __builtins__['FileNotFoundError'] + FileNotFoundError = builtins.FileNotFoundError def identity(a):