Remove an unused argument in Path.touch() (#6700)

This commit is contained in:
Pradyun Gedam 2019-07-13 11:52:22 +05:30 committed by GitHub
commit 16ef685f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -234,8 +234,9 @@ class Path(_base):
with open(self, "w") as fp:
fp.write(content)
def touch(self, times=None):
def touch(self):
with open(self, "a") as fp:
os.utime(fp.fileno() if os.utime in supports_fd else self, times)
path = fp.fileno() if os.utime in supports_fd else self
os.utime(path, None) # times is not optional on Python 2.7
curdir = Path(os.path.curdir)