Skip to content

Commit

Permalink
fix: handle deprecation of datetime.utcnow()
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Jan 9, 2025
1 parent 3b3743b commit 1e893dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions binderhub/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import json
import logging
from datetime import datetime
import datetime

import jsonschema
from jupyterhub.traitlets import Callable
Expand Down Expand Up @@ -98,8 +98,9 @@ def emit(self, schema_name, version, event):
schema = self.schemas[(schema_name, version)]
jsonschema.validate(event, schema)

now_utc = datetime.datetime.now(tz=datetime.timezone.utc)
capsule = {
"timestamp": datetime.utcnow().isoformat() + "Z",
"timestamp": now_utc.isoformat() + "Z",
"schema": schema_name,
"version": version,
}
Expand Down

0 comments on commit 1e893dc

Please sign in to comment.