diff options
author | R. Tyler Ballance <tyler@slide.com> | 2009-03-25 21:27:09 -0700 |
---|---|---|
committer | R. Tyler Ballance <tyler@slide.com> | 2009-03-25 21:27:09 -0700 |
commit | 1797e2c677103dbb39839ea6c57238b10b3e23c6 (patch) | |
tree | fa6dc4b534f8fa1e7249feef5d052ca4a74547c7 | |
parent | fd32d1efc6462733653460a51f0e277f68de4d50 (diff) | |
download | python-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.py | 4 |
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 |