summaryrefslogtreecommitdiff
path: root/file_utils.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-02-02 13:47:36 -0800
committerScott <[email protected]>2022-02-02 13:47:36 -0800
commit7ff2af6fe7bffea90dc4a31c93140c189917c659 (patch)
tree34cb138c3a572037b5bc1d1b52ad9d25a2604ccb /file_utils.py
parent6ba90a1f30f1c0cf4df12fcd0c62181f29bc3668 (diff)
Let's be explicit with asserts; there was a bug in histogram
caused by assert foo when foo was an int with valid valid 0.
Diffstat (limited to 'file_utils.py')
-rw-r--r--file_utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/file_utils.py b/file_utils.py
index 905e23b..deda45e 100644
--- a/file_utils.py
+++ b/file_utils.py
@@ -330,13 +330,13 @@ def get_file_md5(filename: str) -> str:
def set_file_raw_atime(filename: str, atime: float):
mtime = get_file_raw_mtime(filename)
- assert mtime
+ assert mtime is not None
os.utime(filename, (atime, mtime))
def set_file_raw_mtime(filename: str, mtime: float):
atime = get_file_raw_atime(filename)
- assert atime
+ assert atime is not None
os.utime(filename, (atime, mtime))