Skip to content

Commit

Permalink
Fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Dec 13, 2023
1 parent 823d0dd commit 11b229c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modules/getpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,9 @@ getpath_realpath(PyObject *Py_UNUSED(self) , PyObject *args)
Py_END_ALLOW_THREADS

if (err) {
return PyErr_SetFromWindowsErr(GetLastError());
}
if (len <= MAXPATHLEN) {
PyErr_SetFromWindowsErr(err);
result = NULL;
} else if (len <= MAXPATHLEN) {
const wchar_t *p = resolved;
if (0 == wcsncmp(p, L"\\\\?\\", 4)) {
if (GetFileAttributesW(&p[4]) != INVALID_FILE_ATTRIBUTES) {
Expand Down

0 comments on commit 11b229c

Please sign in to comment.