Skip to content

Commit 767fc57

Browse files
committed
adapter.http: Fix reference to constant from the future
Currently, we're using `datetime.UTC`, a constant defined in the built-in `datetime` module. However, this constant was only introduced in Python version 3.11, as you can see in the documentation: - Does not exist in [datetime Python 3.10] - Exists in [datetime python 3.11] We did not catch this, as we most likely programmed the module with Python >= 3.11 and our CI also ran `mypy` with Python 3.12. [datetime Python 3.10]: https://docs.python.org/3.10/library/datetime.html#constants [datetime python 3.11]: https://docs.python.org/3.11/library/datetime.html#datetime.UTC Fixes #330
1 parent 1e93fa5 commit 767fc57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sdk/basyx/aas/adapter/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(self, code: str, text: str, message_type: MessageType = MessageType
8080
self.code: str = code
8181
self.text: str = text
8282
self.message_type: MessageType = message_type
83-
self.timestamp: datetime.datetime = timestamp if timestamp is not None else datetime.datetime.now(datetime.UTC)
83+
self.timestamp: datetime.datetime = timestamp if timestamp is not None else datetime.datetime.now(datetime.timezone.utc)
8484

8585

8686
class Result:

0 commit comments

Comments
 (0)