Py3 fixes
authorStefan Behnel <scoder@users.berlios.de>
Sat, 10 Apr 2010 18:06:40 +0000 (20:06 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 10 Apr 2010 18:06:40 +0000 (20:06 +0200)
Cython/Compiler/ModuleNode.py

index 56fb98b7fbc7b93d7cf0e0bc5cc801326eca5105..55c386d1187d3d5a81c8000d73e42f0fc23e26f5 100644 (file)
@@ -408,7 +408,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
         for module in modules:
             defined_here = module is env
             modulecode.putln("/* Module declarations from %s */" %
-                       module.qualified_name.encode("ASCII", "ignore"))
+                             module.qualified_name)
             self.generate_global_declarations(module, modulecode, defined_here)
             self.generate_cfunction_predeclarations(module, modulecode, defined_here)
 
@@ -632,11 +632,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
     def generate_includes(self, env, cimported_modules, code):
         includes = []
         for filename in env.include_files:
-            # fake decoding of filenames to their original byte sequence
-            if filename[0] == '<' and filename[-1] == '>':
-                code.putln('#include %s' % filename)
+            byte_decoded_filenname = str(filename)
+            if byte_decoded_filenname[0] == '<' and byte_decoded_filenname[-1] == '>':
+                code.putln('#include %s' % byte_decoded_filenname)
             else:
-                code.putln('#include "%s"' % filename)
+                code.putln('#include "%s"' % byte_decoded_filenname)
     
     def generate_filename_table(self, code):
         code.putln("")