Skip to content
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

Support Python 3.9 #176

Merged
merged 2 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
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
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ matrix:
- python: 3.8
env: TOXENV=py38
dist: xenial
- python: 3.9-dev
env: TOXENV=py39
dist: xenial
- python: pypy
env: TOXENV=pypy
- env: TOXENV=pep8
Expand Down
10 changes: 8 additions & 2 deletions readme_renderer/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
import pygments
import pygments.lexers
import pygments.formatters
from six.moves import html_parser

try:
from six.moves.html_parser import unescape
except ImportError: # Python 2
from six.moves import html_parser

unescape = html_parser.HTMLParser().unescape

from .clean import clean

Expand Down Expand Up @@ -99,7 +105,7 @@ def replacer(match):
# translate '"' to '"', but it confuses pygments. Pygments will
# escape any html entities when re-writing the code, and we run
# everything through bleach after.
code = html_parser.HTMLParser().unescape(code)
code = unescape(code)

highlighted = pygments.highlight(code, lexer, formatter)

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,pypy,py35,py36,py37,py38,pep8,py2pep8,packaging,noextra
envlist = py27,pypy,py35,py36,py37,py38,py39,pep8,py2pep8,packaging,noextra

[testenv]
deps =
Expand Down