-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[BUG] import xxx.yyy as zzz
broken with language_level=2 (regression from 0.29.x)
#5308
Comments
This seems a critical bug that we should fix for beta-2. I expect quite a number of projects to keep their existing code base on |
Agree. I'm actually quite surprised that this has been missed until now, suggesting few people are using |
Well, there is a test for this that runs in both language levels: I'm looking into it. |
Since cython@4993ba6, we returned the top-level package module instead of the module that was actually imported with its dotted name ("collections" instead of "collections.abc"). Closes cython#5308 See cython#2854
Since cython@4993ba6, we returned the top-level package module instead of the module that was actually imported with its dotted name ("collections" instead of "collections.abc"). Closes cython#5308 See cython#2854
Describe the bug
See code... Note that I compile with language_level 2
Code to reproduce the behaviour:
Add an empty
__init__.py
to testmod (not sure if this is absolutely needed)Compile with
python3 cythonize.py -2if testmod/cabc.pyx && python3 -c "import testmod.cabc"
On the current master this print the
collections
moduleExpected behaviour
It should print the
collections.abc
module (and it does on the 0.29 branch)OS
Linux
Python version
>3
Cython version
current master
Additional context
Bisected to 4993ba6
The text was updated successfully, but these errors were encountered: