Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
84e24e5e
Commit
84e24e5e
authored
Apr 10, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests now pass with Python 3.1.
parent
9d1e3aad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
README.rst
+1
-1
pystache/defaults.py
+7
-0
pystache/tests/test_renderer.py
+2
-2
No files found.
README.rst
View file @
84e24e5e
...
...
@@ -204,7 +204,7 @@ Author
.. _Mustache: http://mustache.github.com/
.. _Mustache spec: https://github.com/mustache/spec
.. _mustache(5): http://mustache.github.com/mustache.5.html
.. _nose: http://
somethingaboutorange.com/mrl/projects/nose/0.11.1/testing.html
.. _nose: http://
readthedocs.org/docs/nose/en/latest/
.. _only unicode strings: http://docs.python.org/howto/unicode.html#tips-for-writing-unicode-aware-programs
.. _PyPI: http://pypi.python.org/pypi/pystache
.. _Pystache: https://github.com/defunkt/pystache
...
...
pystache/defaults.py
View file @
84e24e5e
...
...
@@ -11,6 +11,13 @@ does not otherwise specify a value.
try
:
# Python 3.2 deprecates cgi.escape() and adds the html module as a replacement.
import
html
try
:
# We also need to verify the existence of the escape() method
# due to the following issue:
# http://bugs.python.org/issue14545
html
.
escape
except
AttributeError
:
raise
ImportError
(
"html.escape does not exist"
)
except
ImportError
:
import
cgi
as
html
...
...
pystache/tests/test_renderer.py
View file @
84e24e5e
...
...
@@ -63,8 +63,8 @@ class RendererInitTestCase(unittest.TestCase):
self
.
assertEqual
(
escape
(
">"
),
">"
)
self
.
assertEqual
(
escape
(
'"'
),
"""
)
# Single quotes are escaped
in Python 3 but not Python 2
.
if
sys
.
version_info
<
(
3
,
):
# Single quotes are escaped
only in Python 3.2 and later
.
if
sys
.
version_info
<
(
3
,
2
):
expected
=
"'"
else
:
expected
=
'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment