UnknownTimeZoneError

This commit is contained in:
w-e-w 2022-10-24 21:13:36 +09:00 committed by AUTOMATIC1111
parent 9f79e59a95
commit 0c0028a9d3
1 changed files with 4 additions and 1 deletions

View File

@ -344,7 +344,10 @@ class FilenameGenerator:
time_datetime = datetime.datetime.now()
time_format = args[0] if len(args) > 0 else self.default_time_format
time_zone = pytz.timezone(args[1]) if len(args) > 1 else None
try:
time_zone = pytz.timezone(args[1]) if len(args) > 1 else None
except pytz.exceptions.UnknownTimeZoneError as _:
time_zone = None
time_zone_time = time_datetime.astimezone(time_zone)
try: