Trying other strategy for #19715: use utime(..., None)

This commit is contained in:
Antoine Pitrou 2013-11-23 01:54:27 +01:00
parent f8d0ff9f42
commit c3055be5f3
2 changed files with 3 additions and 8 deletions

View file

@ -6,7 +6,6 @@ import os
import posixpath
import re
import sys
import time
import weakref
try:
import threading
@ -1076,9 +1075,8 @@ 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, (t, t))
self._accessor.utime(self, None)
except OSError:
# Avoid exception chaining
pass