Skip to content

Comments

Fix datetime.datetime.utcnow DeprecationWarning#40

Closed
thesamesam wants to merge 1 commit intogentoo:masterfrom
thesamesam:date
Closed

Fix datetime.datetime.utcnow DeprecationWarning#40
thesamesam wants to merge 1 commit intogentoo:masterfrom
thesamesam:date

Conversation

@thesamesam
Copy link
Member

/usr/share/gemato/gen_fast_metamanifest.py:119: DeprecationWarning:
datetime.datetime.utcnow() is deprecated and scheduled for removal in
a future version. Use timezone-aware objects to represent datetimes in
UTC: datetime.datetime.now(datetime.UTC).

```
/usr/share/gemato/gen_fast_metamanifest.py:119: DeprecationWarning:
datetime.datetime.utcnow() is deprecated and scheduled for removal in
a future version. Use timezone-aware objects to represent datetimes in
UTC: datetime.datetime.now(datetime.UTC).
```

We can't use `datetime.UTC` because of old Python, so use `datetime.timezone.utc`
instead to support <py3.11.

Signed-off-by: Sam James <sam@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant