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

Remove unused __path__ variable (also conflicts with internal Python use of __path__) #1338

Closed
wants to merge 2 commits into from

Conversation

oraluben
Copy link
Contributor

@oraluben oraluben commented Sep 19, 2023

__path__ of a package is treated as iterable, whose elements are search paths of submodules.

The assignment here seems to not have any effect and could cause trouble during the importing. It could be [os.path.dirname(__file__)], but that's still the default value of the value.

__path__ must be an iterable of strings

https://docs.python.org/3/reference/import.html#module-path

@erezsh erezsh changed the title Remove non-standard __path__ modification. Remove unused __path__ variable (also conflicts with internal Python use of __path__) Sep 20, 2023
@erezsh
Copy link
Member

erezsh commented Sep 20, 2023

Sorry, accidentally broke this PR.

But your commit has been accepted into master.

Thanks!

@erezsh erezsh closed this Sep 20, 2023
oraluben added a commit to alibaba/code-data-share-for-python that referenced this pull request Oct 12, 2023
Summary: Do no cache unknown packages when `__path__` is unexpected. Follow up of #43.

Test Plan: All tests

Reviewed-by: -

Issue: (related) lark-parser/lark#1338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants