We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab87b90 commit cf0d164Copy full SHA for cf0d164
atom/src/catom.cpp
@@ -451,7 +451,13 @@ CAtom_setstate( CAtom* self, PyObject* state )
451
return cppy::type_error("__setstate__ requires a mapping");
452
453
// If the -f key is present freeze the object
454
- bool frozen = PyMapping_HasKey(state, atom_flags);
+#if PY_VERSION_HEX >= 0x030D0000
455
+ int frozen = PyMapping_HasKeyWithError( state, atom_flags );
456
+ if ( frozen == -1 )
457
+ return 0;
458
+#else
459
+ int frozen = PyMapping_HasKey( state, atom_flags );
460
+#endif
461
if ( frozen )
462
{
463
if ( PyMapping_DelItem(state, atom_flags) == -1 )
0 commit comments