summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-11-23 14:23:26 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-11-23 14:23:26 (GMT)
commit91a7af3e48b7e36bd937998e7076c3fe2e812de2 (patch)
tree8d9684a94ea7d9ff6752366daf899a3e1a6e7637 /Modules/posixmodule.c
parent93965f7a6bb1e762f7985c6fe247596a3a0e56df (diff)
downloadcpython-91a7af3e48b7e36bd937998e7076c3fe2e812de2.zip
cpython-91a7af3e48b7e36bd937998e7076c3fe2e812de2.tar.gz
cpython-91a7af3e48b7e36bd937998e7076c3fe2e812de2.tar.bz2
Issue #19727: os.utime(..., None) is now potentially more precise under Windows.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 71b1437..4c96204 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -4953,13 +4953,8 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
}
if (utime.now) {
- SYSTEMTIME now;
- GetSystemTime(&now);
- if (!SystemTimeToFileTime(&now, &mtime) ||
- !SystemTimeToFileTime(&now, &atime)) {
- PyErr_SetFromWindowsErr(0);
- goto exit;
- }
+ GetSystemTimeAsFileTime(&mtime);
+ atime = mtime;
}
else {
time_t_to_FILE_TIME(utime.atime_s, utime.atime_ns, &atime);