Remove some redundant code

This commit is contained in:
Simon 2011-03-10 18:30:28 +00:00
parent 4942cc14b0
commit 2339084d15

View File

@ -1973,13 +1973,10 @@ int main(int argc, char *argv[])
PyRun_SimpleString("import sys\nsys.path.append('.')"); PyRun_SimpleString("import sys\nsys.path.append('.')");
PyRun_SimpleString("print 'python present.'"); PyRun_SimpleString("print 'python present.'");
//load the console module and whatnot //load the console module and whatnot
//pname=PyString_FromString("tpt_console");//create string object
//pmodule = PyImport_Import(pname);//import module
PyObject *tpt_console_obj = PyMarshal_ReadObjectFromString(tpt_console_pyc+8, sizeof(tpt_console_pyc)-8); PyObject *tpt_console_obj = PyMarshal_ReadObjectFromString(tpt_console_pyc+8, sizeof(tpt_console_pyc)-8);
pmodule=PyImport_ExecCodeModule("tpt_console", tpt_console_obj); pmodule=PyImport_ExecCodeModule("tpt_console", tpt_console_obj);
if(pmodule!=NULL) if(pmodule!=NULL)
{ {
//Py_DECREF(pname);//throw away the string object
pfunc=PyObject_GetAttrString(pmodule,"handle");//get the handler function pfunc=PyObject_GetAttrString(pmodule,"handle");//get the handler function
if(pfunc && PyCallable_Check(pfunc))//check if it's really a function if(pfunc && PyCallable_Check(pfunc))//check if it's really a function
{ {