Skip to content

Commit

Permalink
Use PyMapping_HasKeyWithError on 3.13+
Browse files Browse the repository at this point in the history
  • Loading branch information
frmdstryr committed Jan 21, 2025
1 parent ab87b90 commit cf0d164
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion atom/src/catom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,13 @@ CAtom_setstate( CAtom* self, PyObject* state )
return cppy::type_error("__setstate__ requires a mapping");

// If the -f key is present freeze the object
bool frozen = PyMapping_HasKey(state, atom_flags);
#if PY_VERSION_HEX >= 0x030D0000
int frozen = PyMapping_HasKeyWithError( state, atom_flags );
if ( frozen == -1 )
return 0;
#else
int frozen = PyMapping_HasKey( state, atom_flags );
#endif
if ( frozen )
{
if ( PyMapping_DelItem(state, atom_flags) == -1 )
Expand Down

0 comments on commit cf0d164

Please sign in to comment.