Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of the deprecated datetime.utcnow method #1758

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions traits/util/event_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import os
import threading
from contextlib import contextmanager
from datetime import datetime
from datetime import datetime, timezone

from traits import trait_notifiers

Expand Down Expand Up @@ -228,7 +228,7 @@ def pre_tracer(self, obj, name, old, new, handler):

"""
indent = self.indent
time = datetime.utcnow().isoformat(" ")
time = datetime.now(timezone.utc).isoformat(" ")
container = self.container
container.record(
ChangeMessageRecord(
Expand All @@ -255,7 +255,7 @@ def post_tracer(self, obj, name, old, new, handler, exception=None):
""" Record a string representation of the trait change return

"""
time = datetime.utcnow().isoformat(" ")
time = datetime.now(timezone.utc).isoformat(" ")
self.indent -= 1
indent = self.indent
if exception:
Expand Down