mirror of
https://github.com/python/cpython.git
synced 2025-11-09 10:01:42 +00:00
Issue #19715: try the utime(..., None) approach again, now that it should be more precise under Windows
This commit is contained in:
parent
91a7af3e48
commit
2cf3917954
2 changed files with 3 additions and 8 deletions
|
|
@ -6,7 +6,6 @@
|
|||
import posixpath
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
import weakref
|
||||
try:
|
||||
import threading
|
||||
|
|
@ -1076,9 +1075,8 @@ def touch(self, mode=0o666, exist_ok=True):
|
|||
# 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, (t, t))
|
||||
self._accessor.utime(self, None)
|
||||
except OSError:
|
||||
# Avoid exception chaining
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue