diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-04 15:21:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-04 15:21:33 +0400 |
commit | 60cd5ee4122ee73e24c47bb8dfba708624bd5eba (patch) | |
tree | 6e434702c89d4862804f10446802361a3a2d006e /source/blender | |
parent | 46227675f3c1f9abe703a753064c6b534dd85eb1 (diff) |
fix for typo when overwriting pythons stdout/stderr, also print errors if they happen here now.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index da40ded9a92..c98322c7f52 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -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 */ |