Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-59013: Set breakpoint on the first executable line in pdb when using break func#112470
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
6 commits Select commit Hold shift + click to select a range
727f6c5 Make break function work consistently
gaogaotiantian 9c33910 Fix test name, add multiline test
gaogaotiantian 8ffd987 📜🤖 Added by blurb_it.
blurb-it[bot] eff6675 Update 2023-11-27-19-54-43.gh-issue-59013.chpQ0e.rst
gaogaotiantian bb1f81a Add line number to the code
gaogaotiantian 3868f88 Update 2023-11-27-19-54-43.gh-issue-59013.chpQ0e.rst
gaogaotiantian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2587,7 +2587,7 @@ def quux(): | ||
| pass | ||
| """.encode(), | ||
| 'bœr', | ||
| ('bœr', 4), | ||
| ('bœr', 5), | ||
iritkatriel marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| ) | ||
| def test_find_function_found_with_encoding_cookie(self): | ||
| @@ -2604,7 +2604,7 @@ def quux(): | ||
| pass | ||
| """.encode('iso-8859-15'), | ||
| 'bœr', | ||
| ('bœr', 5), | ||
| ('bœr', 6), | ||
| ) | ||
| def test_find_function_found_with_bom(self): | ||
| @@ -2614,9 +2614,34 @@ def bœr(): | ||
| pass | ||
| """.encode(), | ||
| 'bœr', | ||
| ('bœr', 1), | ||
| ('bœr', 2), | ||
| ) | ||
| def test_find_function_first_executable_line(self): | ||
| code = textwrap.dedent("""\ | ||
| def foo(): pass | ||
| def bar(): | ||
| pass # line 4 | ||
| def baz(): | ||
| # comment | ||
| pass # line 8 | ||
| def mul(): | ||
| # code on multiple lines | ||
| code = compile( # line 12 | ||
| 'def f()', | ||
| '<string>', | ||
| 'exec', | ||
| ) | ||
| """).encode() | ||
| self._assert_find_function(code, 'foo', ('foo', 1)) | ||
| self._assert_find_function(code, 'bar', ('bar', 4)) | ||
| self._assert_find_function(code, 'baz', ('baz', 8)) | ||
| self._assert_find_function(code, 'mul', ('mul', 12)) | ||
| def test_issue7964(self): | ||
| # open the file as binary so we can force \r\n newline | ||
| with open(os_helper.TESTFN, 'wb') as f: | ||
1 change: 1 addition & 0 deletions 1 Misc/NEWS.d/next/Library/2023-11-27-19-54-43.gh-issue-59013.chpQ0e.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Set breakpoint on the first executable line of the function, instead of the line of function definition when the user do ``break func`` using :mod:`pdb` |
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.
Uh oh!
There was an error while loading. Please reload this page.