summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@slide.com>2009-03-25 21:27:09 -0700
committerR. Tyler Ballance <tyler@slide.com>2009-03-25 21:27:09 -0700
commit1797e2c677103dbb39839ea6c57238b10b3e23c6 (patch)
treefa6dc4b534f8fa1e7249feef5d052ca4a74547c7
parentfd32d1efc6462733653460a51f0e277f68de4d50 (diff)
downloadpython-cheetah-1797e2c677103dbb39839ea6c57238b10b3e23c6.tar.gz
Minor change to force non-string objects passed into the compiler to treat them as unicode objects internally.
Hopefully this turns out to be a minor, but important step in the right direction as far as properly handling *all* strings as Unicode internally and then letting #encoding determine *only* the output format Signed-off-by: R. Tyler Ballance <tyler@slide.com>
-rw-r--r--src/Compiler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Compiler.py b/src/Compiler.py
index c7ae2f7..1d00ff6 100644
--- a/src/Compiler.py
+++ b/src/Compiler.py
@@ -1566,8 +1566,8 @@ class ModuleCompiler(SettingsManager, GenUtils):
self._fileDirName, self._fileBaseName = os.path.split(self._filePath)
self._fileBaseNameRoot, self._fileBaseNameExt = os.path.splitext(self._fileBaseName)
- if not isinstance(source, (str,unicode)):
- source = str(source)
+ if not isinstance(source, basestring):
+ source = unicode(source)
# by converting to string here we allow objects such as other Templates
# to be passed in