Explorar el Código

fix poole.py for utf-8 compatibility

Thomas Buck hace 3 años
padre
commit
cc72514889
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4
    2
      poole.py

+ 4
- 2
poole.py Ver fichero

@@ -1,4 +1,5 @@
1 1
 #!/usr/bin/env python2
2
+# -*- coding: utf-8 -*-
2 3
 
3 4
 # =============================================================================
4 5
 #
@@ -61,7 +62,8 @@ else:
61 62
     import tempfile
62 63
     def exec_(code, envdic):
63 64
         with tempfile.NamedTemporaryFile() as tf:
64
-            tf.write(code)
65
+            tf.write('# -*- coding: utf-8 -*-\n')
66
+            tf.write(code.encode('utf-8'))
65 67
             tf.flush()
66 68
             execfile(tf.name, envdic)
67 69
 
@@ -388,7 +390,7 @@ def build(project, opts):
388 390
         """Abort because of an exception in inlined Python code."""
389 391
         print("abort  : Python %s in %s failed" % (itype, page))
390 392
         print((" %s raising the exception " % itype).center(79, "-"))
391
-        print(inline)
393
+        print(inline.encode('utf-8'))
392 394
         print(" exception ".center(79, "-"))
393 395
         print(exc)
394 396
         sys.exit(1)

Loading…
Cancelar
Guardar