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
Conversation
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>
Lib/test/test_pdb.py
Outdated
| def test_package_without_a_main(self): | ||
| pkg_name = 't_pkg' | ||
| module_name = 't_main' | ||
| os_helper.rmtree(pkg_name) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ;)
There was a problem hiding this comment.
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.
https://bugs.python.org/issue44461
Automerge-Triggered-By: GH:jaraco
The text was updated successfully, but these errors were encountered: