diff options
author | Victor Stinner <vstinner@python.org> | 2020-04-15 01:24:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 01:24:57 (GMT) |
commit | 361dcdcefc80f5729ed18ac0ef73327794fbf400 (patch) | |
tree | 9ec3e27545cbf1f5f082b612ecbeb94b759827f9 /Objects | |
parent | d9ea5cae1d07e1ee8b03540a9367c26205e0e360 (diff) | |
download | cpython-361dcdcefc80f5729ed18ac0ef73327794fbf400.zip cpython-361dcdcefc80f5729ed18ac0ef73327794fbf400.tar.gz cpython-361dcdcefc80f5729ed18ac0ef73327794fbf400.tar.bz2 |
bpo-40268: Remove unused osdefs.h includes (GH-19532)
When the include is needed, add required symbol in a comment.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/exceptions.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 @@ my_basename(PyObject *name) 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; |