Skip to content

Commit e61ad6e

Browse files
committed
mypy errors
1 parent e5d8c0a commit e61ad6e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tagstudio/src/qt/widgets/preview_panel.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,11 @@ def add_field_to_selected(self, field_list: list[QModelIndex]):
492492
def update_date_label(self, filepath: Path | None = None) -> None:
493493
"""Update the "Date Created" and "Date Modified" file property labels."""
494494
if filepath and filepath.is_file():
495+
created: dt = None
495496
if platform.system() == "Windows" or platform.system() == "Darwin":
496-
created: dt = dt.fromtimestamp(filepath.stat().st_birthtime)
497+
created = dt.fromtimestamp(filepath.stat().st_birthtime) # type: ignore[attr-defined]
497498
else:
498-
created: dt = dt.fromtimestamp(filepath.stat().st_ctime)
499+
created = dt.fromtimestamp(filepath.stat().st_ctime)
499500
modified: dt = dt.fromtimestamp(filepath.stat().st_mtime)
500501
self.date_created_label.setText(
501502
f"<b>Date Created:</b> {dt.strftime(created, "%a, %x, %X")}"

0 commit comments

Comments
 (0)