Skip to content

Conversation

@jaraco
Copy link
Member

@jaracojaraco commented Jul 28, 2021

https://bugs.python.org/issue44461

Automerge-Triggered-By: GH:jaraco

GH-27227) * bpo-44461: Fix bug with pdb's handling of import error due to a package which does not have a __main__ module * 📜🤖 Added by blurb_it. * remove "else" Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> * If running as a module, first check that it can run as a module. Alternate fix for bpo-44461. Co-authored-by: Irit Katriel <iritkatriel@yahoo.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>. (cherry picked from commit ee03bad) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
deftest_package_without_a_main(self):
pkg_name='t_pkg'
module_name='t_main'
os_helper.rmtree(pkg_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you're missing an from test.support import os_helper import for this line to work.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Looking at the header, support was already imported, so I re-used that import.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ugh. Bad idea. Okay, going with your suggestion ;)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Suggestion doesn't work either. I remember now, between 3.9 and 3.10, test.support was refactored.

@jaracojaracoforce-pushed the backport-ee03bad-3.9 branch from c29ae78 to 8ae7ef2CompareJuly 28, 2021 21:57
@jaracojaraco merged commit 49b5e20 into 3.9Jul 28, 2021
@jaracojaraco deleted the backport-ee03bad-3.9 branch July 28, 2021 22:48
Sign up for freeto 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.

5 participants

@jaraco@ambv@the-knights-who-say-ni@bedevere-bot