Skip to content

Commit

Permalink
Fix mtime check for list return
Browse files Browse the repository at this point in the history
Fixes #269
  • Loading branch information
DominikDoom committed Jan 27, 2024
1 parent afa1330 commit 08d3436
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scripts/tag_autocomplete_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,17 @@ def needs_restart(self):
script_callbacks.on_ui_settings(on_ui_settings)

def get_style_mtime():
style_file = getattr(shared, "styles_filename", "styles.csv")
style_file = Path(FILE_DIR).joinpath(style_file)
if Path.exists(style_file):
return style_file.stat().st_mtime
try:
style_file = getattr(shared, "styles_filename", "styles.csv")
# Check in case a list is returned
if isinstance(style_file, list):
style_file = style_file[0]

style_file = Path(FILE_DIR).joinpath(style_file)
if Path.exists(style_file):
return style_file.stat().st_mtime
except Exception:
return None

last_style_mtime = get_style_mtime()

Expand Down

0 comments on commit 08d3436

Please sign in to comment.