diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-11-23 01:11:02 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-11-23 01:11:02 (GMT) |
commit | 12820c0d5d6b3ccbd191703d1003794ddb1bcac9 (patch) | |
tree | 660ed2770a578098aff79181924905b94a8bddf8 /Lib/pathlib.py | |
parent | c3055be5f30a4b980356322e11a3d8e119059dbe (diff) | |
download | cpython-12820c0d5d6b3ccbd191703d1003794ddb1bcac9.zip cpython-12820c0d5d6b3ccbd191703d1003794ddb1bcac9.tar.gz cpython-12820c0d5d6b3ccbd191703d1003794ddb1bcac9.tar.bz2 |
Revert utime(..., None) strategy (it has too poor resolution under Windows) and restore the previous test workaround
(issue #19715)
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r-- | Lib/pathlib.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py index e73eca7..06cbae5 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -6,6 +6,7 @@ import os import posixpath import re import sys +import time import weakref try: import threading @@ -1075,8 +1076,9 @@ class Path(PurePath): # First try to bump modification time # Implementation note: GNU touch uses the UTIME_NOW option of # the utimensat() / futimens() functions. + t = time.time() try: - self._accessor.utime(self, None) + self._accessor.utime(self, (t, t)) except OSError: # Avoid exception chaining pass |