projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f21e8b
)
fix imports in compiled Tempita for Py3
author
Stefan Behnel
<stefan_ml@behnel.de>
Fri, 26 Jul 2013 10:00:36 +0000
(12:00 +0200)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Fri, 26 Jul 2013 10:00:36 +0000
(12:00 +0200)
Cython/Tempita/__init__.py
patch
|
blob
|
history
diff --git
a/Cython/Tempita/__init__.py
b/Cython/Tempita/__init__.py
index
85a0f00
..
855225f
100644
(file)
--- a/
Cython/Tempita/__init__.py
+++ b/
Cython/Tempita/__init__.py
@@
-32,10
+32,16
@@
If there are syntax errors ``TemplateError`` will be raised.
import re
import sys
import cgi
-from urllib import quote as url_quote
+try:
+ from urllib import quote as url_quote
+except ImportError: # Py3
+ from urllib.parse import quote as url_quote
import os
import tokenize
-from cStringIO import StringIO
+try:
+ from io import StringIO
+except ImportError:
+ from cStringIO import StringIO
from Cython.Tempita._looper import looper
from Cython.Tempita.compat3 import bytes, basestring_, next, is_unicode, coerce_text