IdentityPython / pysaml2

Python implementation of SAML2
Apache License 2.0
555 stars 422 forks source link

Fix deprecation warning for datetime.datetime.utcnow #939

Open kfrydel opened 11 months ago

kfrydel commented 11 months ago

This fixes #934. utcnow function, starting from Python 3.12 is deprecated: https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow

Thus, this commit turns usages of utcnow() into now(UTC).

Description

The feature or problem addressed by this PR

This addresses the issue described in #934

What your changes do and why you chose this solution

The solution is based on the suggestion from official Python docs: https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow

Checklist