Skip to content

Commit

Permalink
Use datetime.timezone.utc instead of datetime.UTC
Browse files Browse the repository at this point in the history
datetime.UTC was added with Python 3.11
Docs: https://docs.python.org/3/library/datetime.html#datetime.UTC
Fixes: #37
  • Loading branch information
abichinger authored and rkhwaja committed Nov 20, 2024
1 parent d6d1b9c commit e1aca2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/dropboxfs/dropboxfs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from contextlib import closing
from datetime import datetime, UTC
from datetime import datetime, timezone
from io import BytesIO
from logging import getLogger

Expand Down Expand Up @@ -142,7 +142,7 @@ def close(self):
return
writeMode = WriteMode('add') if self.rev is None else WriteMode('update', self.rev)
try:
metadata = self.dropbox.files_upload(self.getvalue(), self.path, mode=writeMode, autorename=False, client_modified=datetime.now(UTC).replace(tzinfo=None), mute=False) # noqa: F841
metadata = self.dropbox.files_upload(self.getvalue(), self.path, mode=writeMode, autorename=False, client_modified=datetime.now(timezone.utc).replace(tzinfo=None), mute=False) # noqa: F841
except ApiError as e:
raise OperationFailed(self.path) from e
# Make sure that we can't call this again
Expand Down

0 comments on commit e1aca2e

Please sign in to comment.