Skip to content

bpo-30629: Fix call lower() twice#2099

Merged
terryjreedy merged 1 commit into
python:masterfrom
narusemotoki:bpo-30629
Jun 17, 2017
Merged

bpo-30629: Fix call lower() twice#2099
terryjreedy merged 1 commit into
python:masterfrom
narusemotoki:bpo-30629

Conversation

@narusemotoki

@narusemotoki narusemotoki commented Jun 11, 2017

Copy link
Copy Markdown
Contributor

https://bugs.python.org/issue30629
https://github.com/python/cpython/blob/master/Lib/html/parser.py#L415

        elem = match.group(1).lower() # script or style
        if self.cdata_elem is not None:
            if elem != self.cdata_elem:
                self.handle_data(rawdata[i:gtpos])
                return gtpos

        self.handle_endtag(elem.lower())

elem is lowercase string because lower() is called at the first line.
So the last line of calling lower() is unnecessary.

https://bugs.python.org/issue30629
https://github.com/python/cpython/blob/master/Lib/html/parser.py#L415

```
        elem = match.group(1).lower() # script or style
        if self.cdata_elem is not None:
            if elem != self.cdata_elem:
                self.handle_data(rawdata[i:gtpos])
                return gtpos

        self.handle_endtag(elem.lower())
```

elem is lowercase string because lower() is called at the first line.
So the last line of calling lower() is unnecessary.
@mention-bot

Copy link
Copy Markdown

@narusemotoki, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ezio-melotti, @freddrake and @bitdancer to be potential reviewers.

@the-knights-who-say-ni

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@narusemotoki

Copy link
Copy Markdown
Contributor Author

@rhettinger @the-knights-who-say-ni
Hello
Now, I can see "Contributor Form Received Yes" on my profile page. How can I run CLA check again or Could I ask you to do it?

@terryjreedy terryjreedy merged commit 3358d58 into python:master Jun 17, 2017
@narusemotoki narusemotoki deleted the bpo-30629 branch June 20, 2017 04:13
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.

6 participants