Merge pull request #1367 from PlasmaPower/noatime-fix

Fixed noatime detection
This commit is contained in:
enkore 2016-07-23 20:15:24 +02:00 committed by GitHub
commit 91a9c35bd3
1 changed files with 2 additions and 1 deletions

View File

@ -393,7 +393,8 @@ class ArchiverTestCase(ArchiverTestCaseBase):
def has_noatime(some_file): def has_noatime(some_file):
atime_before = os.stat(some_file).st_atime_ns atime_before = os.stat(some_file).st_atime_ns
try: try:
os.close(os.open(some_file, flags_noatime)) with open(os.open(some_file, flags_noatime)) as file:
file.read()
except PermissionError: except PermissionError:
return False return False
else: else: