Skip to content

modulefinder: use only dirs containing no __init__.py as namespace package #7108

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

Merged
merged 3 commits into from
Jul 3, 2019

Conversation

awelzel
Copy link
Contributor

@awelzel awelzel commented Jun 30, 2019

When used with --namespace-packages, a directory containing no __init__.pyi
was previously added as a candidate to near_misses even if it contained
a __init__.py. This logic doesn't seem sensible, particularly as this
directory was then chosen as the result of find_module() instead of
the __init__.py inside the directory.

This should cure #5854.

awelzel added 2 commits June 30, 2019 18:01
…ckage

When used with --namespace-packages, a directory containing no __init__.pyi
was previously added as a candidate to near_misses even if it contained
a __init__.py. This logic doesn't seem sensible, particularly as this
directory was then chosen as the result of find_module() instead of
the __init__.py inside the directory.

This should cure python#5854.
Those tests go hand in hand with the directory structure that was
created in test-data/packages/modulefinder.
...and some more explaining comments.
@awelzel awelzel force-pushed the namespace-package-init branch from 3dd8ffd to 6a4cab9 Compare July 1, 2019 11:12
@awelzel awelzel mentioned this pull request Jul 3, 2019
@gvanrossum gvanrossum self-requested a review July 3, 2019 13:40
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this looks right. Thanks for finding and fixing this bug!

@gvanrossum gvanrossum merged commit b724cca into python:master Jul 3, 2019
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.

2 participants