Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
jaraco merged 3 commits into
3.9python/cpython:3.9from
backport-ee03bad-3.9python/cpython:backport-ee03bad-3.9Copy head branch name to clipboard
Jul 28, 2021
Merged

[3.9] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227)#27400
jaraco merged 3 commits into
3.9python/cpython:3.9from
backport-ee03bad-3.9python/cpython:backport-ee03bad-3.9Copy head branch name to clipboard

Conversation

@jaraco

@jaraco jaraco commented Jul 28, 2021

Copy link
Copy Markdown
Member

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>
Comment thread 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)

Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

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

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 Compare July 28, 2021 21:57
@jaraco jaraco merged commit 49b5e20 into 3.9 Jul 28, 2021
@jaraco jaraco deleted the backport-ee03bad-3.9 branch July 28, 2021 22:48
Sign up for free to 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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.