Skip to content

Conversation

@wchargin
Copy link
Contributor

Summary:
The html.escape function superseded cgi.escape in Python 3.2, prior
to which the html module did not exist. We now unconditionally import
html, without falling back to cgi.

Part of #4488.

Test Plan:
Tested the Pip package in Jupyter. When rebased on top of #4507, which
removes the unittest.mock backport, a git grep -A1 '^try:' shows
that the remaining top-level conditional statements are okay: a bunch of
TensorFlow compatibility incantations for summaries, and one conditional
import of botocore.

wchargin-branch: py3-html-escape

Summary:
The `html.escape` function superseded `cgi.escape` in Python 3.2, prior
to which the `html` module did not exist. We now unconditionally import
`html`, without falling back to `cgi`.

Part of #4488.

Test Plan:
Tested the Pip package in Jupyter. When rebased on top of #4507, which
removes the `unittest.mock` backport, a `git grep -A1 '^try:'` shows
that the remaining top-level conditional statements are okay: a bunch of
TensorFlow compatibility incantations for summaries, and one conditional
import of `botocore`.

wchargin-branch: py3-html-escape
wchargin-source: 2f17731ec538eb904d673edccf63310afa585ef3
@google-cla google-cla bot added the cla: yes label Dec 28, 2020
@wchargin wchargin mentioned this pull request Dec 28, 2020
10 tasks
@wchargin wchargin requested a review from stephanwlee January 5, 2021 17:18
@wchargin wchargin merged commit 6900cc3 into master Jan 5, 2021
@wchargin wchargin deleted the wchargin-py3-html-escape branch January 5, 2021 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants