Skip to content
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] Misleading error message when trying to cimport in pure Python #5185

Open
da-woods opened this issue Dec 29, 2022 · 0 comments
Open

[BUG] Misleading error message when trying to cimport in pure Python #5185

da-woods opened this issue Dec 29, 2022 · 0 comments

Comments

@da-woods
Copy link
Contributor

da-woods commented Dec 29, 2022

Describe the bug

If you use the cimport keyword in pure Python it doesn't work (correctly). However, the error message suggests that you should use the cimport keyword

Code to reproduce the behaviour:

from cython.operator cimport dereference

Output is:

from cython.operator cimport dereference
                     ^
------------------------------------------------------------

somefilename.py:1:21: Expected 'import' or 'cimport'

Expected behaviour

A useful error message. This isn't quite as simple as it looks because the cython module wants to be imported, while most other thing want from cython.cimports.... Although given that this is at the parsing stage, it'd probably be sufficient to just write expected "import"

Environment

Current master

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant