Skip to content

Commit e40659e

Browse files
committed
Use PyPtr for 312+ to handle incref in PyGen_GetCode
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
1 parent 1a414af commit e40659e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cpp/csp/python/PyNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void PyNode::init( PyObjectPtr inputs, PyObjectPtr outputs )
9494
#if IS_PRE_PYTHON_3_12
9595
PyCodeObject * code = frame -> f_code;
9696
#else
97-
PyCodeObject * code = PyGen_GetCode( ( PyGenObject * ) pygen );
97+
PyPtr<PyCodeObject> code = PyPtr<PyCodeObject>::own( PyGen_GetCode( ( PyGenObject * ) pygen ) );
9898
#endif
9999
int localPlusIndex = 0;
100100
for( int stackloc = code -> co_argcount; stackloc < code -> co_nlocalsplus; ++stackloc, ++localPlusIndex )

0 commit comments

Comments
 (0)