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

[3.9] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227) #27400

Merged
merged 3 commits into from Jul 28, 2021

Conversation

@jaraco
Copy link
Member

@jaraco jaraco 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>
def test_package_without_a_main(self):
pkg_name = 't_pkg'
module_name = 't_main'
os_helper.rmtree(pkg_name)
Copy link
Contributor

@ambv ambv Jul 28, 2021

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
Member Author

@jaraco jaraco Jul 28, 2021

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
Member Author

@jaraco jaraco Jul 28, 2021

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
Member Author

@jaraco jaraco Jul 28, 2021

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.

@jaraco jaraco force-pushed the backport-ee03bad-3.9 branch from c29ae78 to 8ae7ef2 Jul 28, 2021
@jaraco jaraco merged commit 49b5e20 into 3.9 Jul 28, 2021
14 checks passed
@jaraco jaraco deleted the backport-ee03bad-3.9 branch Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants