8000
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 7a6dea1 commit c620a61Copy full SHA for c620a61
Modules/_queuemodule.c
@@ -385,17 +385,15 @@ static int
385
queuemodule_exec(PyObject *module)
386
{
387
simplequeue_state *state = simplequeue_get_state(module);
388
+
389
state->EmptyError = PyErr_NewExceptionWithDoc(
390
"_queue.Empty",
391
"Exception raised by Queue.get(block=0)/get_nowait().",
392
NULL, NULL);
393
if (state->EmptyError == NULL) {
394
return -1;
395
}
-
396
- Py_INCREF(state->EmptyError);
397
- if (PyModule_AddObject(module, "Empty", state->EmptyError) < 0) {
398
- Py_CLEAR(state->EmptyError);
+ if (PyModule_AddObjectRef(module, "Empty", state->EmptyError) < 0) {
399
400
401
0 commit comments