-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing importlib
re-exported top-level modules
#10746
Conversation
Avasam
commented
Sep 21, 2023
Diff from mypy_primer, showing the effect of this PR on open source code: kornia (https://github.com/kornia/kornia)
- kornia/testing/__init__.py:20: error: Module has no attribute "util" [attr-defined]
|
This definitely isn't always the case:
Maybe you have something in |
I concur with @hauntsaninja, with the caveat that Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.machinery
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'importlib' has no attribute 'machinery' Python 3.10.8 | packaged by conda-forge | (main, Nov 24 2022, 14:07:00) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.machinery
<module 'importlib.machinery' from 'C:\\Users\\alexw\\.conda\\envs\\py310\\lib\\importlib\\machinery.py'> Python 3.13.0a0 (heads/main:d4cea794a7, Sep 21 2023, 13:24:35) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.machinery
<module 'importlib.machinery' (frozen)> |
Hum, I came across this in pywin32 https://github.com/mhammond/pywin32/blob/main/win32/Lib/win32serviceutil.py#L20 Edit: ran |
I also see
|
Smart. So I had util
machinery``` Error processing line 3 of C:\Program Files\Python39\lib\site-packages\flake8_helper.pth:Traceback (most recent call last): Remainder of file ignored
|
Seems like we shouldn't make this change. |