10000 bpo-34480: fix bug where match variable is used prior to being defined by jkamdjou · Pull Request #17643 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-34480: fix bug where match variable is used prior to being defined #17643

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
1 change: 1 addition & 0 deletions Lib/_markupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def parse_marked_section(self, i, report=1):
# look for MS Office ]> ending
match= _msmarkedsectionclose.search(rawdata, i+3)
else:
match = None
Copy link
Member
91B2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed this branch to raise an AssertionError in #8562. Depending on @ezio-melotti's feedback, I can also change it to return -1. In both cases, this PR may not be needed so I'd suggest waiting for #8562 to be resolved first.

I think it would be nice to have a test case that hits to this branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8562 has been merged, so I think this can be closed.

self.error('unknown status keyword %r in marked section' % rawdata[i+3:j])
if not match:
return -1
Expand Down
0