Show More
@@ -207,9 +207,7 b' static PyObject *listdir(PyObject *self,' | |||
|
207 | 207 | |
|
208 | 208 | fh = FindFirstFileA(pattern, &fd); |
|
209 | 209 | if (fh == INVALID_HANDLE_VALUE) { |
|
210 |
PyErr_Set |
|
|
211 | GetLastError(), | |
|
212 | path); | |
|
210 | PyErr_SetFromWindowsErrWithFilename(GetLastError(), path); | |
|
213 | 211 | goto error_file; |
|
214 | 212 | } |
|
215 | 213 | |
@@ -244,9 +242,7 b' static PyObject *listdir(PyObject *self,' | |||
|
244 | 242 | } while (FindNextFileA(fh, &fd)); |
|
245 | 243 | |
|
246 | 244 | if (GetLastError() != ERROR_NO_MORE_FILES) { |
|
247 |
PyErr_Set |
|
|
248 | GetLastError(), | |
|
249 | path); | |
|
245 | PyErr_SetFromWindowsErrWithFilename(GetLastError(), path); | |
|
250 | 246 | goto error; |
|
251 | 247 | } |
|
252 | 248 | |
@@ -294,9 +290,10 b' static PyObject *listdir(PyObject *self,' | |||
|
294 | 290 | &path, &pathlen, &statflag, &skip)) |
|
295 | 291 | goto error_parse; |
|
296 | 292 | |
|
297 | if (pathlen >= PATH_MAX) | |
|
293 | if (pathlen >= PATH_MAX) { | |
|
294 | PyErr_SetString(PyExc_ValueError, "path too long"); | |
|
298 | 295 | goto error_parse; |
|
299 | ||
|
296 | } | |
|
300 | 297 | strncpy(fullpath, path, PATH_MAX); |
|
301 | 298 | fullpath[pathlen] = '/'; |
|
302 | 299 | keepstat = statflag && PyObject_IsTrue(statflag); |
General Comments 0
You need to be logged in to leave comments.
Login now