From 46a49fb4211991f9b30f34ee8207e88f2db97ef9 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Wed, 11 Apr 2012 16:29:58 +0000 Subject: [PATCH] [0.1.x] fixed : output for standalone python app with stdout redirection git-svn-id: https://pykd.svn.codeplex.com/svn@75464 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/dbgio.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pykd/dbgio.cpp b/pykd/dbgio.cpp index 5b47d2a..fb09709 100644 --- a/pykd/dbgio.cpp +++ b/pykd/dbgio.cpp @@ -25,7 +25,8 @@ void DebugClient::dprint( const std::wstring &str, bool dml ) } else { - std::wcout << str; + python::object sys = python::import("sys"); + sys.attr("stdout").attr("write")( str ); } } @@ -64,7 +65,8 @@ void DebugClient::eprint( const std::wstring &str ) } else { - std::wcerr << str; + python::object sys = python::import("sys"); + sys.attr("stderr").attr("write")( str ); } } @@ -104,7 +106,8 @@ DbgOut::write( const std::wstring &str ) } else { - std::wcerr << str; + python::object sys = python::import("sys"); + sys.attr("stderr").attr("write")( str ); } }