More type annotations.
[python_utils.git] / persistent.py
index d62dd6754eeffc78c1c09adea7c82e778f8450b3..7136559492ed0615366db854412c02c9024c7022 100644 (file)
@@ -64,6 +64,7 @@ def was_file_written_today(filename: str) -> bool:
         return False
 
     mtime = file_utils.get_file_mtime_as_datetime(filename)
+    assert mtime
     now = datetime.datetime.now()
     return mtime.month == now.month and mtime.day == now.day and mtime.year == now.year
 
@@ -80,6 +81,7 @@ def was_file_written_within_n_seconds(
         return False
 
     mtime = file_utils.get_file_mtime_as_datetime(filename)
+    assert mtime
     now = datetime.datetime.now()
     return (now - mtime).total_seconds() <= limit_seconds
 
@@ -126,7 +128,6 @@ class persistent_autoloaded_singleton(object):
         self.instance = None
 
     def __call__(self, cls: Persistent):
-        @functools.wraps(cls)
         def _load(*args, **kwargs):
 
             # If class has already been loaded, act like a singleton