Skip to content

Commit

Permalink
fix pyright errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex O committed Feb 6, 2024
1 parent 607188b commit 5024cf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flathunt.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def launch_flat_hunt(config, heartbeat: Heartbeat):
if config_handle is not None:
new_config = Config(filename=config_handle.name, silent=True)

if None in (config.last_modified_time, new_config.last_modified_time):
if config.last_modified_time is None or new_config.last_modified_time is None:
logger.warning("Could not compare last modification time of config file."
"Keeping the old configuration")
elif config.last_modified_time < new_config.last_modified_time:
Expand Down
7 changes: 6 additions & 1 deletion flathunter/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ def __init__(self, config=None):
self.config = config
self.__searchers__ = []
self.check_deprecated()
self.last_modified_time: Optional[float] = self.get_last_modified_time(self.config.get("filename"))
if filename := self.config.get("filename"):
self.last_modified_time: Optional[float] = self.get_last_modified_time(filename)
else:
self.last_modified_time: Optional[float] = None



def __iter__(self):
"""Emulate dictionary"""
Expand Down

0 comments on commit 5024cf8

Please sign in to comment.