bpo-40268: Remove unused osdefs.h includes (GH-19532)
When the include is needed, add required symbol in a comment.
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 69a6b5c..ca917b4 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -9,7 +9,7 @@
#include "pycore_initconfig.h"
#include "pycore_object.h"
#include "structmember.h" // PyMemberDef
-#include "osdefs.h"
+#include "osdefs.h" // SEP
/* Compatibility aliases */
@@ -1435,11 +1435,13 @@
size = PyUnicode_GET_LENGTH(name);
offset = 0;
for(i=0; i < size; i++) {
- if (PyUnicode_READ(kind, data, i) == SEP)
+ if (PyUnicode_READ(kind, data, i) == SEP) {
offset = i + 1;
+ }
}
- if (offset != 0)
+ if (offset != 0) {
return PyUnicode_Substring(name, offset, size);
+ }
else {
Py_INCREF(name);
return name;