Compare commits

...

2 Commits

Author SHA1 Message Date
Rayyan Ansari db58eae29c
Merge 32813e5962 into b82bf4a232 2024-03-12 20:14:33 +01:00
Rayyan Ansari 32813e5962 testsuite: only use follow_symlinks if supported
On Windows, follow_symlinks is not supported by every os function yet, using False can raise a NotImplementedError.
Check os.supports_follow_symlinks to decide whether to use True or False.
2023-08-01 23:28:42 +01:00
1 changed files with 2 additions and 2 deletions

View File

@ -147,8 +147,8 @@ def is_utime_fully_supported():
else:
open(filepath, "w").close()
try:
os.utime(filepath, (1000, 2000), follow_symlinks=False)
new_stats = os.stat(filepath, follow_symlinks=False)
os.utime(filepath, (1000, 2000), follow_symlinks=False if os.utime in os.supports_follow_symlinks else True)
new_stats = os.stat(filepath, follow_symlinks=False if os.stat in os.supports_follow_symlinks else True)
if new_stats.st_atime == 1000 and new_stats.st_mtime == 2000:
return True
except OSError: