From af3e45bae6aff2895e11d83424c63660c825d5dc Mon Sep 17 00:00:00 2001
From: "SND\\kernelnet_cp"
 <SND\kernelnet_cp@9b283d60-5439-405e-af05-b73fd8c4d996>
Date: Sat, 8 Jan 2011 13:27:38 +0000
Subject: [PATCH] [!] bug fixed: issue #8103 ( !py windbg extension imports
 modules into the global space )

git-svn-id: https://pykd.svn.codeplex.com/svn@59901 9b283d60-5439-405e-af05-b73fd8c4d996
---
 pykd/dbgext.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pykd/dbgext.cpp b/pykd/dbgext.cpp
index 5988238..b14f11a 100644
--- a/pykd/dbgext.cpp
+++ b/pykd/dbgext.cpp
@@ -96,7 +96,7 @@ BOOST_PYTHON_MODULE( pykd )
     boost::python::def( "dprintln", &DbgPrint::dprintln );
     boost::python::def( "loadDump", &dbgLoadDump );
     boost::python::def( "dbgCommand", &dbgCommand );
-    boost::python::def( "is64bitSystem", is64bitSystem );
+    boost::python::def( "is64bitSystem", &is64bitSystem );
     boost::python::def( "isKernelDebugging", &isKernelDebugging );
     boost::python::def( "ptrSize", ptrSize );
     boost::python::def( "reg", &loadRegister );
@@ -241,6 +241,8 @@ HRESULT
 CALLBACK
 py( PDEBUG_CLIENT4 client, PCSTR args)
 {
+    PyThreadState   *interpreter = Py_NewInterpreter();
+
     try {
     
         DbgExt      ext = { 0 };
@@ -255,7 +257,7 @@ py( PDEBUG_CLIENT4 client, PCSTR args)
         boost::python::object       global(main.attr("__dict__"));
         
         // ��������������� ����������� ������� ��
-        boost::python::object       sys = boost::python::import( "sys");
+        boost::python::object       sys = boost::python::import("sys");
         
         dbgOut                      dout;
         sys.attr("stdout") = boost::python::object( dout );
@@ -349,6 +351,8 @@ py( PDEBUG_CLIENT4 client, PCSTR args)
     {           
     }     
     
+    Py_EndInterpreter( interpreter ); 
+    
     return S_OK;  
 }