Skip to content

Commit

Permalink
fixup! fix: Python 3.11 date.fromisoformat() allows extra formats
Browse files Browse the repository at this point in the history
  • Loading branch information
jvtm committed Mar 28, 2023
1 parent 0b2ce61 commit 956ff9f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jsonschema/_format.py
Expand Up @@ -398,7 +398,10 @@ def is_regex(instance: object) -> bool:
def is_date(instance: object) -> bool:
if not isinstance(instance, str):
return True
return bool(_RE_DATE.fullmatch(instance) and datetime.date.fromisoformat(instance))
return bool(
_RE_DATE.fullmatch(instance)
and datetime.date.fromisoformat(instance)
)


@_checks_drafts(draft3="time", raises=ValueError)
Expand Down

0 comments on commit 956ff9f

Please sign in to comment.