-
-
Notifications
You must be signed in to change notification settings - Fork 306
Closed
Labels
Milestone
Description
PyPy 3.9 is broken as we can't detect their builtins module. We use the __spec__ attribute, but that is no longer set on that version. Difference in output is:
import sys
print(sys.modules["builtins"].__spec__)❯ python --version
Python 3.8.12
❯ python test.py
ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>)
❯ python --version
Python 3.9.6
❯ python test.py
ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in')
❯ python --version
Python 3.8.12 (9ef55f6fc369, Oct 25 2021, 05:10:01)
[PyPy 7.3.7 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.3)]
❯ python test.py
ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in')
❯ python --version
Python 3.9.12 (05fbe3aa5b0845e6c37239768aa455451aa5faba, Mar 29 2022, 09:54:47)
[PyPy 7.3.9 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.30)]
❯ python test.py
NoneI have reported this against them, but their response was basically that we should try and find a way to detect builtins in another way as the fact that it worked on 3.8 was not by design but more by chance.
I haven't looked into a possible solution, but just wanted to track this issue here as well.
See:
https://foss.heptapod.net/pypy/pypy/-/issues/3736#note_184637