Skip to content

Commit 9fd5412

Browse files
committed
fix: _PyErr_SetKeyError is removed in Python 3.13
Python 3.13 moved this undocumented function to private API. See python/cpython#108607
1 parent a8ac1f6 commit 9fd5412

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/JSObjectProxy.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,6 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method(JSObje
669669
return value;
670670
}
671671

672-
// Python 3.13 moved this undocumented function to private API. Re-exporting it here.
673-
extern void _PyErr_SetKeyError(PyObject *);
674-
675672
PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs) {
676673
PyObject *key;
677674
PyObject *default_value = NULL;
@@ -696,7 +693,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy
696693
Py_INCREF(default_value);
697694
return default_value;
698695
}
699-
_PyErr_SetKeyError(key);
696+
PyErr_SetObject(PyExc_KeyError, key);
700697
return NULL;
701698
}
702699
else {

0 commit comments

Comments
 (0)