Skip to content

Commit

Permalink
In Fmt.format, warn about no placeholders only if there is also no ti…
Browse files Browse the repository at this point in the history
…me format codes
  • Loading branch information
user committed Apr 25, 2024
1 parent 0b3120a commit e297969
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion avtdl/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def format(cls, fmt: str, record: Record, missing: Optional[str] = None, tz: Opt
result = cls.strftime(fmt, datetime.datetime.now(tz))
record_as_dict = record.model_dump()
placeholders: List[str] = re.findall(r'({[^{}\\]+})', fmt)
if not placeholders:
if not placeholders and result == fmt:
logger.debug(f'format string "{fmt}" has no placeholders, it will be the same for all records')
for placeholder in placeholders:
field = placeholder.strip('{}')
Expand Down

0 comments on commit e297969

Please sign in to comment.