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 98e3e4e commit 89e6f14Copy full SHA for 89e6f14
Python/_warnings.c
@@ -933,18 +933,18 @@ setup_context(Py_ssize_t stack_level,
933
}
934
935
/* Setup module. */
936
- *module = < 8000 span class=pl-en>_PyDict_GetItemWithError(globals, &_Py_ID(__name__));
937
- if (*module == Py_None || (*module != NULL && PyUnicode_Check(*module))) {
938
- Py_INCREF(*module);
939
- }
940
- else if (_PyErr_Occurred(tstate)) {
+ rc = PyDict_GetItemRef(globals, &_Py_ID(__name__), module);
+ if (rc < 0) {
941
goto handle_error;
942
943
- else {
+ if (rc == 0) {
944
*module = PyUnicode_FromString("<string>");
945
if (*module == NULL)
946
947
+ else {
+ assert(Py_IsNone(*module) || PyUnicode_Check(*module));
+ }
948
949
return 1;
950
0 commit comments