Re: Python 3.8 porting help

2019-09-26 Thread Petr Viktorin
On 2019-09-26 14:03, Richard Shaw wrote: On Thu, Sep 26, 2019 at 3:55 AM Petr Viktorin > wrote: Actually, this is in FreeCAD code: FreeCAD-0.18.3/src/Base/swigpyrun.inl: PyObject *modules = interp->modules; Change "interp->modules" to "PyImport_GetMo

Re: Python 3.8 porting help

2019-09-26 Thread Richard Shaw
On Thu, Sep 26, 2019 at 3:55 AM Petr Viktorin wrote: > Actually, this is in FreeCAD code: > > FreeCAD-0.18.3/src/Base/swigpyrun.inl: PyObject *modules = interp->modules; > > Change "interp->modules" to "PyImport_GetModuleDict()" there. > Not being a c/c++ programmer I wasn't sure if it was liter

Re: Python 3.8 porting help

2019-09-26 Thread Petr Viktorin
Actually, this is in FreeCAD code: FreeCAD-0.18.3/src/Base/swigpyrun.inl: PyObject *modules = interp->modules; Change "interp->modules" to "PyImport_GetModuleDict()" there. On 2019-09-24 16:33, Victor Stinner wrote: Hi, It sounds like an issue in SWIG which access directly the PyInterpreterS

Re: Python 3.8 porting help

2019-09-24 Thread Victor Stinner
Hi, It sounds like an issue in SWIG which access directly the PyInterpreterState structure which became opaque in Python 3.8. SWIG should use PyImport_GetModuleDict() public function instead, to access PyImport_GetModuleDict(). In short, it returns interp->modules. Victor Le mar. 24 sept. 2019

Re: Python 3.8 porting help

2019-09-24 Thread Petr Viktorin
Victor, do you know the answer here? Blender has the same issue: https://bugzilla.redhat.com/show_bug.cgi?id=1734980 (but I forgot to CC you there) On 2019-09-24 14:57, Richard Shaw wrote: I maintain FreeCAD for Fedora and there appears to have been a change in the API for how Python handles

Python 3.8 porting help

2019-09-24 Thread Richard Shaw
I maintain FreeCAD for Fedora and there appears to have been a change in the API for how Python handles thread management in 3.8, specifically PyInterpreterState which is giving the the following error when trying to build FreeCAD: In file included from /builddir/build/BUILD/FreeCAD-0.18.3/src/Bas