Skip to content

Comments

Replace deprecated method datetime.utcnow#187

Open
Manitary wants to merge 1 commit intor-anime:masterfrom
Manitary:remove-deprecated-utcnow
Open

Replace deprecated method datetime.utcnow#187
Manitary wants to merge 1 commit intor-anime:masterfrom
Manitary:remove-deprecated-utcnow

Conversation

@Manitary
Copy link
Contributor

datetime.utcnow is deprecated with Python 3.12, and eventually will be removed (see here).

Ideally everything should be made timezone-aware, but for now this commit simply replaces calls to datetime.utcnow() by calling datetime.now(UTC) and stripping the timezone information to make it naive, to keep the current behaviour.

(also remove the local flag from Episode.is_live, it is never used and it never could be since properties don't take arguments)

Instead, call `datetime.now` with UTC tzinfo and remove the tzinfo

Remove the `local` flag from `Episode.is_live` since it is a property
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