fix for typo when overwriting pythons stdout/stderr, also print errors if they happen...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 4 Dec 2012 11:21:33 +0000 (11:21 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 4 Dec 2012 11:21:33 +0000 (11:21 +0000)
source/blender/python/intern/bpy_interface.c

index da40ded9a924c55d19596a90af774dada05b30a4..c98322c7f52d398b279f8ac10c158bb4f947ee0e 100644 (file)
@@ -276,7 +276,11 @@ void BPY_python_start(int argc, const char **argv)
                           "sys.__stdout__ = sys.stdout = io.TextIOWrapper(io.open(sys.stdout.fileno(), 'wb', -1), "
                           "encoding='utf-8', errors='surrogateescape', newline='\\n', line_buffering=True)\n"
                           "sys.__stderr__ = sys.stderr = io.TextIOWrapper(io.open(sys.stderr.fileno(), 'wb', -1), "
-                          "ncoding='utf-8', errors='surrogateescape', newline='\\n', line_buffering=True)\n");
+                          "encoding='utf-8', errors='surrogateescape', newline='\\n', line_buffering=True)\n");
+       if (PyErr_Occurred()) {
+               PyErr_Print();
+               PyErr_Clear();
+       }
 #endif
        /* end the baddness */