Commit c3823193 authored by Tim Golden's avatar Tim Golden

Issue4905: use INVALID_FILE_ATTRIBUTES where appropriate. (Patch by Ulrich Eckhardt)

parent 333e095d
...@@ -342,6 +342,7 @@ Maxim Dzumanenko ...@@ -342,6 +342,7 @@ Maxim Dzumanenko
Walter Dörwald Walter Dörwald
Hans Eckardt Hans Eckardt
Rodolpho Eckhardt Rodolpho Eckhardt
Ulrich Eckhardt
David Edelsohn David Edelsohn
John Edmonds John Edmonds
Grant Edwards Grant Edwards
......
...@@ -2666,7 +2666,7 @@ os_access_impl(PyObject *self, path_t *path, int mode, int dir_fd, int effective ...@@ -2666,7 +2666,7 @@ os_access_impl(PyObject *self, path_t *path, int mode, int dir_fd, int effective
* (Directories cannot be read-only on Windows.) * (Directories cannot be read-only on Windows.)
*/ */
return_value = PyBool_FromLong( return_value = PyBool_FromLong(
(attr != 0xFFFFFFFF) && (attr != INVALID_FILE_ATTRIBUTES) &&
(!(mode & 2) || (!(mode & 2) ||
!(attr & FILE_ATTRIBUTE_READONLY) || !(attr & FILE_ATTRIBUTE_READONLY) ||
(attr & FILE_ATTRIBUTE_DIRECTORY))); (attr & FILE_ATTRIBUTE_DIRECTORY)));
...@@ -2938,7 +2938,7 @@ posix_chmod(PyObject *self, PyObject *args, PyObject *kwargs) ...@@ -2938,7 +2938,7 @@ posix_chmod(PyObject *self, PyObject *args, PyObject *kwargs)
attr = GetFileAttributesW(path.wide); attr = GetFileAttributesW(path.wide);
else else
attr = GetFileAttributesA(path.narrow); attr = GetFileAttributesA(path.narrow);
if (attr == 0xFFFFFFFF) if (attr == INVALID_FILE_ATTRIBUTES)
result = 0; result = 0;
else { else {
if (mode & _S_IWRITE) if (mode & _S_IWRITE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment