Skip to content

Commit

Permalink
Suppress deprecation warnings on Py3k.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Dec 29, 2014
1 parent 23ef7a7 commit fbf75a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/zope/structuredtext/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
""" HTML renderer for STX documents.
"""

from cgi import escape
try:
from html import escape
except ImportError: # pragma: NO COVER Python2
from cgi import escape
else: # pragma: NO COVER Py3k
from functools import partial
escape = partial(escape, quote=False)

__metaclass__ = type

Expand Down
2 changes: 1 addition & 1 deletion src/zope/structuredtext/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def testDocumentClass(self):
doc = Document()
raw_text = readFile(regressions, f)
text = stng.structurize(raw_text)
self.assert_(doc(text))
self.assertTrue(doc(text))

def testRegressionsTests(self):
# HTML regression test
Expand Down

0 comments on commit fbf75a7

Please sign in to comment.