Skip to content

Commit

Permalink
Fix path building. Improve assertion error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
nomike committed Sep 18, 2024
1 parent 3aa6cb5 commit 561e359
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templatehelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def getlastmodifiedfile(path):
Recursively search for the newest file in the specified directory.
"""

path = os.path.join('..', path)
assert os.path.isdir(path)
path = os.path.join('.', path)
assert os.path.isdir(path), f'{path} is not a directory!'
newest = {"file": path, "timestamp": os.path.getmtime(path)}
for root, dirs, files in os.walk(path):
for directory in dirs:
Expand Down

0 comments on commit 561e359

Please sign in to comment.