From: <bh...@us...> - 2008-05-30 16:56:50
|
Revision: 10513 http://swig.svn.sourceforge.net/swig/?rev=10513&view=rev Author: bhy Date: 2008-05-30 09:56:48 -0700 (Fri, 30 May 2008) Log Message: ----------- clean up unused code Modified Paths: -------------- branches/gsoc2008-bhy/Lib/python/pyhead.swg branches/gsoc2008-bhy/Lib/python/pyrun.swg Modified: branches/gsoc2008-bhy/Lib/python/pyhead.swg =================================================================== --- branches/gsoc2008-bhy/Lib/python/pyhead.swg 2008-05-30 16:17:24 UTC (rev 10512) +++ branches/gsoc2008-bhy/Lib/python/pyhead.swg 2008-05-30 16:56:48 UTC (rev 10513) @@ -8,42 +8,6 @@ #define PyInt_FromLong(x) PyLong_FromLong(x) #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -/* -PyObject* PyInstance_NewRaw(PyObject *klass, PyObject *dict) -{ - PyTypeObject *inst; - printf("Entering PyInstance_NewRaw...\n"); - if (!PyClass_Check(klass)) { - PyErr_BadInternalCall(); - return NULL; - } - if (dict == NULL) { - dict = PyDict_New(); - if (dict == NULL) - return NULL; - } - else { - if (!PyDict_Check(dict)) { - PyErr_BadInternalCall(); - return NULL; - } - Py_INCREF(dict); - } - inst = PyObject_GC_New(PyTypeObject,(PyTypeObject*)klass);// PyBaseObject_Type); - if (inst == NULL) { - Py_DECREF(dict); - return NULL; - } - //inst->tp_weaklist = NULL; - Py_INCREF(klass); - //inst->in_class = (PyClassObject *)klass; - Py_TYPE(inst)->tp_dict = dict; - //Py_TYPE(inst) = (PyTypeObject *)klass; - _PyObject_GC_TRACK(inst); - printf("PyInstance_NewRaw calling succ...\n"); - return (PyObject *)inst; -} -*/ #endif /* Add PyOS_snprintf for old Pythons */ Modified: branches/gsoc2008-bhy/Lib/python/pyrun.swg =================================================================== --- branches/gsoc2008-bhy/Lib/python/pyrun.swg 2008-05-30 16:17:24 UTC (rev 10512) +++ branches/gsoc2008-bhy/Lib/python/pyrun.swg 2008-05-30 16:56:48 UTC (rev 10513) @@ -1028,15 +1028,7 @@ } } #else -/*#if PY_VERSION_HEX >= 0x03000000 - PyObject **dict_ptr = _PyObject_GetDictPtr(pyobj); - printf("TRYING GET THIS FROM: %s %p\n", Py_TYPE(pyobj)->tp_name, pyobj); - obj = dict_ptr ? PyDict_GetItem(*dict_ptr, SWIG_This()) : 0; - if(obj) printf("%s\n", Py_TYPE(obj)->tp_name); - else printf("***Get item failed!!\n"); -#else*/ obj = PyObject_GetAttr(pyobj,SWIG_This()); -//#endif if (obj) { Py_DECREF(obj); } else { @@ -1242,20 +1234,9 @@ } } else { #if PY_VERSION_HEX >= 0x03000000 - //inst = PyObject_New(PyObject, (PyTypeObject*) data->newargs); inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); Py_INCREF(data->newargs); PyObject_SetAttr(inst, SWIG_This(), swig_this); - //printf("***Setting %p\n", inst); - //*_PyObject_GetDictPtr(inst) = PyDict_New(); - /*if(PyDict_SetItem(*_PyObject_GetDictPtr(inst), SWIG_This(), swig_this) < 0) - { - printf("***PyDict_SetItem Failed!!\n"); - } - if(! PyDict_GetItem(*_PyObject_GetDictPtr(inst), SWIG_This())) - { - printf("*** yeah... failed to set.\n"); - }*/ Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; #else PyObject *dict = PyDict_New(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |