Skip to content
Open
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
5 changes: 2 additions & 3 deletions asyncpool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from datetime import datetime, timezone

def utc_now():
# utcnow returns a naive datetime, so we have to set the timezone manually <sigh>
return datetime.utcnow().replace(tzinfo=timezone.utc)
return datetime.now(tz=timezone.utc)

class Terminator:
pass
Expand Down Expand Up @@ -151,4 +150,4 @@ async def join(self):
self._logger.debug('Completed {}'.format(self._name))

if self._exceptions and self._raise_on_join:
raise Exception("Exception occurred in pool {}".format(self._name))
raise Exception("Exception occurred in pool {}".format(self._name))