Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tirkarthi
Copy link
Member

@tirkarthi tirkarthi commented Mar 24, 2019

Handle namespace packages in doctest where __file__ of empty package returns None

https://bugs.python.org/issue36406

@tirkarthi
Copy link
Member Author

Note to self and reviewer : I have originally added a fix to handle filename to None and finder is also documented to accept None. But the previous code seems to always default to module.__name__ where __file__ attribute was absent for empty packages previously. So I changed this to getattr(module, '__file__', module.__name__) or module.__name__ to remove check for filename to be None.

@tirkarthi
Copy link
Member Author

Ping @warsaw for review. This was caused due to a23d30f where __file__ was set as None for empty packages causing doctest to fail for empty packages.

@csabella csabella added the type-bug An unexpected behavior, bug, or error label May 29, 2019
@csabella csabella requested review from warsaw and brettcannon May 29, 2019 11:49
@tirkarthi tirkarthi changed the title bpo-36406: Handle empty packages in doctest bpo-36406: Handle namespace packages in doctest Sep 11, 2019
@brettcannon brettcannon self-requested a review September 13, 2019 10:33
@brettcannon
Copy link
Member

@warsaw anything to say before this gets merged?

@tirkarthi if Barry doesn't say anything in a week just ping me and I will merge this.

@tirkarthi
Copy link
Member Author

@brettcannon Ping for merge. Thanks.

@brettcannon brettcannon self-assigned this Dec 10, 2019
@brettcannon
Copy link
Member

@tirkarthi thanks for the ping. I will merge this probably this week or next when I have the time.

@brettcannon brettcannon merged commit 8289e27 into python:master Dec 13, 2019
@miss-islington
Copy link
Contributor

Thanks @tirkarthi for the PR, and @brettcannon for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 13, 2019
@bedevere-bot
Copy link

GH-17591 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 13, 2019
@bedevere-bot
Copy link

GH-17592 is a backport of this pull request to the 3.7 branch.

brettcannon pushed a commit that referenced this pull request Dec 13, 2019
brettcannon pushed a commit that referenced this pull request Dec 13, 2019
@tirkarthi
Copy link
Member Author

Thanks @brettcannon and @methane for review :)

shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants