File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -917,13 +917,12 @@ setup_context(Py_ssize_t stack_level,
917
917
/* Setup registry. */
918
918
assert (globals != NULL );
919
919
assert (PyDict_Check (globals ));
920
- * registry = _PyDict_GetItemWithError (globals , & _Py_ID (__warningregistry__ ));
920
+ int rc = PyDict_GetItemRef (globals , & _Py_ID (__warningregistry__ ),
921
+ registry );
922
+ if (rc < 0 ) {
923
+ goto handle_error ;
924
+ }
921
925
if (* registry == NULL ) {
922
- int rc ;
923
-
924
- if (_PyErr_Occurred (tstate )) {
925
- goto handle_error ;
926
- }
927
926
* registry = PyDict_New ();
928
927
if (* registry == NULL )
929
928
goto handle_error ;
@@ -932,8 +931,6 @@ setup_context(Py_ssize_t stack_level,
932
931
if (rc < 0 )
933
932
goto handle_error ;
934
933
}
935
- else
936
- Py_INCREF (* registry );
937
934
938
935
/* Setup module. */
939
936
* module = _PyDict_GetItemWithError (globals , & _Py_ID (__name__ ));
You can’t perform that action at this time.
0 commit comments