From 1724a42cdb9b2879dba1ba8dc6be54c8b4e63d94 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Wed, 15 Apr 2015 14:19:04 +0000 Subject: [PATCH] [pykd_bootstrapper] fixed : !pykd.install outputs an error message git-svn-id: https://pykd.svn.codeplex.com/svn@90386 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd_bootstrapper/version.h | 2 +- pykd_bootstrapper/windbgext.cpp | 9 ++++++--- setup/setup.py | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pykd_bootstrapper/version.h b/pykd_bootstrapper/version.h index 20cf500..bea5853 100644 --- a/pykd_bootstrapper/version.h +++ b/pykd_bootstrapper/version.h @@ -3,7 +3,7 @@ #define PYKDEXT_VERSION_MAJOR 1 #define PYKDEXT_VERSION_MINOR 0 #define PYKDEXT_VERSION_SUBVERSION 1 -#define PYKDEXT_VERSION_BUILDNO 2 +#define PYKDEXT_VERSION_BUILDNO 3 #define __VER_STR2__(x) #x #define __VER_STR1__(x) __VER_STR2__(x) diff --git a/pykd_bootstrapper/windbgext.cpp b/pykd_bootstrapper/windbgext.cpp index db7bf28..0211a25 100644 --- a/pykd_bootstrapper/windbgext.cpp +++ b/pykd_bootstrapper/windbgext.cpp @@ -220,8 +220,6 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdBootsTrapper, py) } else { - std::string scriptFileName = getScriptFileName(args[0]); - // устанавиливаем питоновские аргументы char **pythonArgs = new char*[args.size()]; @@ -348,7 +346,6 @@ void PykdBootsTrapper::setUp() python::object main_namespace = main.attr("__dict__"); - // Python debug output console helper classes python::class_<::DbgOut>("dout", "dout", python::no_init) .def("write", &::DbgOut::write) @@ -360,6 +357,12 @@ void PykdBootsTrapper::setUp() .def("readline", &::DbgIn::readline) .add_property("encoding", &::DbgIn::encoding); + python::object sys = python::import("sys"); + + sys.attr("stdout") = python::object(::DbgOut()); + sys.attr("stderr") = python::object(::DbgOut()); + sys.attr("stdin") = python::object(::DbgIn()); + m_pyState = PyEval_SaveThread(); } diff --git a/setup/setup.py b/setup/setup.py index 8ede833..557a4b4 100644 --- a/setup/setup.py +++ b/setup/setup.py @@ -8,7 +8,7 @@ import zipfile _name = "pykd" _desc = "python windbg extension" -_version = '0.3.0.21' +_version = '0.3.0.22' def makeWheel(args): @@ -81,7 +81,7 @@ def makeZip(args): else: assert(0) - zip_str = "pykd-%s-py27-%s.zip" % ( _version, args.plat_name ) + zip_str = "pykd-%s-py27-%s" % ( _version, args.plat_name ) zip_name = zip_str + ".zip" assert(os.path.isdir(bin_dir))