From 1d54c701643635807bf5f9af09361dfc4df830d7 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Fri, 16 May 2025 22:45:24 +0000 Subject: [PATCH] Update uses of recordclass and utcfromtimestamp() --- hippolyzer/lib/base/legacy_schema.py | 4 ++-- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hippolyzer/lib/base/legacy_schema.py b/hippolyzer/lib/base/legacy_schema.py index d878e6c..60b20c8 100644 --- a/hippolyzer/lib/base/legacy_schema.py +++ b/hippolyzer/lib/base/legacy_schema.py @@ -46,7 +46,7 @@ class SchemaFieldSerializer(abc.ABC, Generic[_T]): class SchemaDate(SchemaFieldSerializer[dt.datetime]): @classmethod def deserialize(cls, val: str) -> dt.datetime: - return dt.datetime.utcfromtimestamp(int(val)) + return dt.datetime.fromtimestamp(int(val), dt.timezone.utc) @classmethod def serialize(cls, val: dt.datetime) -> str: @@ -54,7 +54,7 @@ class SchemaDate(SchemaFieldSerializer[dt.datetime]): @classmethod def from_llsd(cls, val: Any, flavor: str) -> dt.datetime: - return dt.datetime.utcfromtimestamp(val) + return dt.datetime.fromtimestamp(val, dt.timezone.utc) @classmethod def to_llsd(cls, val: dt.datetime, flavor: str): diff --git a/requirements.txt b/requirements.txt index 378955b..4c6f8ad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -58,7 +58,7 @@ pyperclip==1.8.2 PySide6-Essentials==6.6.1 python-dateutil==2.8.2 qasync==0.27.1 -recordclass==0.18.2 +recordclass==0.23.1 ruamel.yaml==0.18.5 ruamel.yaml.clib==0.2.8 service-identity==23.1.0 diff --git a/setup.py b/setup.py index 0b7f4ec..1ec45f7 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ setup( 'defusedxml', 'aiohttp<4.0.0', # Newer recordclasses break! - 'recordclass>0.15,<0.18.3', + 'recordclass>=0.23.1,<0.24', 'lazy-object-proxy', # requests breaks with newer idna 'idna<3,>=2.5',