[3.9] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227)#27400
Merged
[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>
ambv
reviewed
Jul 28, 2021
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) |
Contributor
There was a problem hiding this comment.
Looks like you're missing an from test.support import os_helper import for this line to work.
Member
Author
There was a problem hiding this comment.
Looking at the header, support was already imported, so I re-used that import.
Member
Author
There was a problem hiding this comment.
Ugh. Bad idea. Okay, going with your suggestion ;)
Member
Author
There was a problem hiding this comment.
Suggestion doesn't work either. I remember now, between 3.9 and 3.10, test.support was refactored.
c29ae78 to
8ae7ef2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://bugs.python.org/issue44461
Automerge-Triggered-By: GH:jaraco