[Checkins] SVN: Sandbox/malthe/Chameleon/src/chameleon/core/generation.py Encode code if encoding is enabled.

Malthe Borch mborch at gmail.com
Sat Sep 20 14:47:27 EDT 2008


Log message for revision 91290:
  Encode code if encoding is enabled.

Changed:
  U   Sandbox/malthe/Chameleon/src/chameleon/core/generation.py

-=-
Modified: Sandbox/malthe/Chameleon/src/chameleon/core/generation.py
===================================================================
--- Sandbox/malthe/Chameleon/src/chameleon/core/generation.py	2008-09-20 18:45:55 UTC (rev 91289)
+++ Sandbox/malthe/Chameleon/src/chameleon/core/generation.py	2008-09-20 18:47:26 UTC (rev 91290)
@@ -108,8 +108,10 @@
         self.annotations[self.l_counter] = item
 
     def out(self, string):
+        if isinstance(string, unicode) and self.encoding:
+            string = string.encode(self.encoding)
         self.queue += string
-
+            
     def cook(self):
         if self.queue:
             queue = self.queue



More information about the Checkins mailing list