summaryrefslogtreecommitdiff
path: root/pystache/defaults.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-04-10 22:31:28 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-04-10 22:31:28 -0700
commit84e24e5e8451d1845129c4e9d7c3fcf10995ca08 (patch)
tree8aef5456af069c5e40b32cc8e9c024e6e3446b93 /pystache/defaults.py
parent9d1e3aad107b37794d383ff37fa3590c6f1bc45c (diff)
downloadpystache-84e24e5e8451d1845129c4e9d7c3fcf10995ca08.tar.gz
Tests now pass with Python 3.1.
Diffstat (limited to 'pystache/defaults.py')
-rw-r--r--pystache/defaults.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pystache/defaults.py b/pystache/defaults.py
index bb989c5..e12e635 100644
--- a/pystache/defaults.py
+++ b/pystache/defaults.py
@@ -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