From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Q8eFe-0002Lu-RK for garchives@archives.gentoo.org; Sat, 09 Apr 2011 19:55:23 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 11B79E0160; Sat, 9 Apr 2011 19:55:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B7D87E0160 for ; Sat, 9 Apr 2011 19:55:13 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 04CFF1B4065 for ; Sat, 9 Apr 2011 19:55:13 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2244) id 9842720057; Sat, 9 Apr 2011 19:55:11 +0000 (UTC) From: "Arfrever Frehtes Taifersar Arahesis (arfrever)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, arfrever@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in dev-python/pycxx/files: pycxx-6.2.3-python-3.2.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: pycxx-6.2.3-python-3.2.patch X-VCS-Directories: dev-python/pycxx/files X-VCS-Committer: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis Content-Type: text/plain; charset=utf8 Message-Id: <20110409195511.9842720057@flycatcher.gentoo.org> Date: Sat, 9 Apr 2011 19:55:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: cb5243b6dd9cb4fb220525e6aa1300d7 arfrever 11/04/09 19:55:11 Added: pycxx-6.2.3-python-3.2.patch Log: Fix compatibility with Python 3.2 (bug #292415). =20 (Portage version: 2.2.0_alpha29_p10/cvs/Linux x86_64) Revision Changes Path 1.1 dev-python/pycxx/files/pycxx-6.2.3-python-3.2.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pycxx/f= iles/pycxx-6.2.3-python-3.2.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pycxx/f= iles/pycxx-6.2.3-python-3.2.patch?rev=3D1.1&content-type=3Dtext/plain Index: pycxx-6.2.3-python-3.2.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D http://cxx.svn.sourceforge.net/viewvc?view=3Drevision&revision=3D266 --- CXX/Python3/ExtensionModule.hxx +++ CXX/Python3/ExtensionModule.hxx @@ -82,8 +82,6 @@ extern "C" PyObject *method_varargs_call_handler( PyObject *_self_an= d_name_tuple, PyObject *_args ); extern "C" PyObject *method_keyword_call_handler( PyObject *_self_an= d_name_tuple, PyObject *_args, PyObject *_keywords ); =20 - extern "C" void do_not_dealloc( void * ); - template class ExtensionModule : public ExtensionModuleBase { @@ -134,11 +132,11 @@ { MethodDefExt *method_def =3D (*i).second; =20 - static PyObject *self =3D PyCObject_FromVoidPtr( this, d= o_not_dealloc ); + static PyObject *self =3D PyCapsule_New( this, NULL, NUL= L ); =20 Tuple args( 2 ); args[0] =3D Object( self ); - args[1] =3D Object( PyCObject_FromVoidPtr( method_def, d= o_not_dealloc ) ); + args[1] =3D Object( PyCapsule_New( method_def, NULL, NUL= L ) ); =20 PyObject *func =3D PyCFunction_New ( --- CXX/Python3/ExtensionOldType.hxx +++ CXX/Python3/ExtensionOldType.hxx @@ -178,7 +178,7 @@ Tuple self( 2 ); =20 self[0] =3D Object( this ); - self[1] =3D Object( PyCObject_FromVoidPtr( method_def, do_no= t_dealloc ) ); + self[1] =3D Object( PyCapsule_New( method_def, NULL, NULL ) = ); =20 PyObject *func =3D PyCFunction_New( &method_def->ext_meth_de= f, self.ptr() ); =20 @@ -237,7 +237,7 @@ T *self =3D static_cast( self_in_cobject ); =20 MethodDefExt *meth_def =3D reinterpret_cast *>( - PyCObject_AsVoidPtr( sel= f_and_name_tuple[1].ptr() ) ); + PyCapsule_GetPointer( se= lf_and_name_tuple[1].ptr(), NULL ) ); =20 Object result; =20 @@ -273,7 +273,7 @@ PyObject *self_in_cobject =3D self_and_name_tuple[0].ptr= (); T *self =3D static_cast( self_in_cobject ); MethodDefExt *meth_def =3D reinterpret_cast *>( - PyCObject_AsVoidPtr( sel= f_and_name_tuple[1].ptr() ) ); + PyCapsule_GetPointer( se= lf_and_name_tuple[1].ptr(), NULL ) ); =20 Tuple args( _args ); =20 @@ -310,7 +310,7 @@ PyObject *self_in_cobject =3D self_and_name_tuple[0].ptr= (); T *self =3D static_cast( self_in_cobject ); MethodDefExt *meth_def =3D reinterpret_cast *>( - PyCObject_AsVoidPtr( sel= f_and_name_tuple[1].ptr() ) ); + PyCapsule_GetPointer( se= lf_and_name_tuple[1].ptr(), NULL ) ); =20 Tuple args( _args ); =20 --- CXX/Python3/IndirectPythonInterface.hxx +++ CXX/Python3/IndirectPythonInterface.hxx @@ -109,9 +109,6 @@ PyTypeObject * _Method_Type(); bool _Method_Check( PyObject *op ); =20 -PyTypeObject * _CObject_Type(); -bool _CObject_Check( PyObject *op ); - PyTypeObject * _Complex_Type(); bool _Complex_Check( PyObject *op ); =20 --- Src/IndirectPythonInterface.cxx +++ Src/IndirectPythonInterface.cxx @@ -40,7 +40,6 @@ namespace Py { bool _CFunction_Check( PyObject *op ) { return op->ob_type =3D=3D _CFu= nction_Type(); } -bool _CObject_Check( PyObject *op ) { return op->ob_type =3D=3D _COb= ject_Type(); } bool _Complex_Check( PyObject *op ) { return op->ob_type =3D=3D _Com= plex_Type(); } bool _Dict_Check( PyObject *op ) { return op->ob_type =3D=3D _Dic= t_Type(); } bool _Float_Check( PyObject *op ) { return op->ob_type =3D=3D _Flo= at_Type(); } @@ -59,6 +58,7 @@ #if PY_MAJOR_VERSION =3D=3D 2 bool _String_Check( PyObject *op ) { return op->ob_type =3D=3D _Str= ing_Type(); } bool _Int_Check( PyObject *op ) { return op->ob_type =3D=3D _Int= _Type(); } +bool _CObject_Check( PyObject *op ) { return op->ob_type =3D=3D _COb= ject_Type(); } #endif #if PY_MAJOR_VERSION >=3D 3 bool _Bytes_Check( PyObject *op ) { return op->ob_type =3D=3D _Byt= es_Type(); } @@ -111,7 +111,6 @@ static PyObject *ptr__PyFalse =3D NULL; static PyObject *ptr__PyTrue =3D NULL; static PyTypeObject *ptr__CFunction_Type =3D NULL; -static PyTypeObject *ptr__CObject_Type =3D NULL; static PyTypeObject *ptr__Complex_Type =3D NULL; static PyTypeObject *ptr__Dict_Type =3D NULL; static PyTypeObject *ptr__Float_Type =3D NULL; @@ -129,6 +128,7 @@ #if PY_MAJOR_VERSION =3D=3D 2 static PyTypeObject *ptr__Int_Type =3D NULL; static PyTypeObject *ptr__String_Type =3D NULL; +static PyTypeObject *ptr__CObject_Type =3D NULL; #endif #if PY_MAJOR_VERSION >=3D 3 static PyTypeObject *ptr__Bytes_Type =3D NULL; @@ -284,7 +284,6 @@ ptr__PyTrue =3D GetPyObject_As_PyObjectPointer( "_Py= _TrueStruct" ); =20 ptr__CFunction_Type =3D GetPyTypeObject_As_PyTypeObjectPoint= er( "PyCFunction_Type" ); - ptr__CObject_Type =3D GetPyTypeObject_As_PyTypeObjectPoint= er( "PyCObject_Type" ); ptr__Complex_Type =3D GetPyTypeObject_As_PyTypeObjectPoint= er( "PyComplex_Type" ); ptr__Dict_Type =3D GetPyTypeObject_As_PyTypeObjectPoint= er( "PyDict_Type" ); ptr__Float_Type =3D GetPyTypeObject_As_PyTypeObjectPoint= er( "PyFloat_Type" ); @@ -303,6 +302,7 @@ #if PY_MAJOR_VERSION =3D=3D 2 ptr__String_Type =3D GetPyTypeObject_As_PyTypeObjectPoint= er( "PyString_Type" ); ptr__Int_Type =3D GetPyTypeObject_As_PyTypeObjectPoint= er( "PyInt_Type" ); + ptr__CObject_Type =3D GetPyTypeObject_As_PyTypeObjectPoint= er( "PyCObject_Type" ); #endif #if PY_MAJOR_VERSION >=3D 3 ptr__Bytes_Type =3D GetPyTypeObject_As_PyTypeObjectPoint= er( "PyBytes_Type" ); @@ -367,7 +367,6 @@ PyObject *_True() { return ptr__PyTrue; } =20 PyTypeObject *_CFunction_Type() { return ptr__CFunction_Type; } -PyTypeObject *_CObject_Type() { return ptr__CObject_Type; } PyTypeObject *_Complex_Type() { return ptr__Complex_Type; } PyTypeObject *_Dict_Type() { return ptr__Dict_Type; } PyTypeObject *_Float_Type() { return ptr__Float_Type; } @@ -386,6 +385,7 @@ #if PY_MAJOR_VERSION =3D=3D 2 PyTypeObject *_String_Type() { return ptr__String_Type; } PyTypeObject *_Int_Type() { return ptr__Int_Type; } +PyTypeObject *_CObject_Type() { return ptr__CObject_Type; } #endif #if PY_MAJOR_VERSION >=3D 3 PyTypeObject *_Bytes_Type() { return ptr__Bytes_Type; } @@ -506,7 +506,6 @@ PyObject *_True() { return Py_True; } =20 PyTypeObject *_CFunction_Type() { return &PyCFunction_Type; } -PyTypeObject *_CObject_Type() { return &PyCObject_Type; } PyTypeObject *_Complex_Type() { return &PyComplex_Type; } PyTypeObject *_Dict_Type() { return &PyDict_Type; } PyTypeObject *_Float_Type() { return &PyFloat_Type; } @@ -525,6 +524,7 @@ #if PY_MAJOR_VERSION =3D=3D 2 PyTypeObject *_String_Type() { return &PyString_Type; } PyTypeObject *_Int_Type() { return &PyInt_Type; } +PyTypeObject *_CObject_Type() { return &PyCObject_Type; } #endif #if PY_MAJOR_VERSION >=3D 3 PyTypeObject *_Bytes_Type() { return &PyBytes_Type; } --- Src/Python3/cxx_extensions.cxx +++ Src/Python3/cxx_extensions.cxx @@ -1471,13 +1471,13 @@ Tuple self_and_name_tuple( _self_and_name_tuple ); =20 PyObject *self_in_cobject =3D self_and_name_tuple[0].ptr(); - void *self_as_void =3D PyCObject_AsVoidPtr( self_in_cobject ); + void *self_as_void =3D PyCapsule_GetPointer( self_in_cobject, NU= LL ); if( self_as_void =3D=3D NULL ) return NULL; =20 ExtensionModuleBase *self =3D static_cast= ( self_as_void ); =20 - Object result( self->invoke_method_noargs( PyCObject_AsVoidPtr( = self_and_name_tuple[1].ptr() ) ) ); + Object result( self->invoke_method_noargs( PyCapsule_GetPointer(= self_and_name_tuple[1].ptr(), NULL ) ) ); =20 return new_reference_to( result.ptr() ); } @@ -1494,7 +1494,7 @@ Tuple self_and_name_tuple( _self_and_name_tuple ); =20 PyObject *self_in_cobject =3D self_and_name_tuple[0].ptr(); - void *self_as_void =3D PyCObject_AsVoidPtr( self_in_cobject ); + void *self_as_void =3D PyCapsule_GetPointer( self_in_cobject, NU= LL ); if( self_as_void =3D=3D NULL ) return NULL; =20 @@ -1504,7 +1504,7 @@ ( self->invoke_method_varargs ( - PyCObject_AsVoidPtr( self_and_name_tuple[1].ptr() ), + PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), = NULL ), args ) ); @@ -1524,7 +1524,7 @@ Tuple self_and_name_tuple( _self_and_name_tuple ); =20 PyObject *self_in_cobject =3D self_and_name_tuple[0].ptr(); - void *self_as_void =3D PyCObject_AsVoidPtr( self_in_cobject ); + void *self_as_void =3D PyCapsule_GetPointer( self_in_cobject, NU= LL ); if( self_as_void =3D=3D NULL ) return NULL; =20 @@ -1540,7 +1540,7 @@ ( self->invoke_method_keyword ( - PyCObject_AsVoidPtr( self_and_name_tuple[1].ptr() ), + PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), = NULL ), args, keywords ) @@ -1556,7 +1556,7 @@ ( self->invoke_method_keyword ( - PyCObject_AsVoidPtr( self_and_name_tuple[1].ptr(= ) ), + PyCapsule_GetPointer( self_and_name_tuple[1].ptr= (), NULL ), args, keywords ) @@ -1571,9 +1571,6 @@ } } =20 -extern "C" void do_not_dealloc( void * ) -{} - =20 //----------------------------------------------------------------------= ---------- //