Update uses of recordclass and utcfromtimestamp()

This commit is contained in:
Salad Dais
2025-05-16 22:45:24 +00:00
parent 6dafe32f6a
commit 1d54c70164
3 changed files with 4 additions and 4 deletions

View File

@@ -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):

View File

@@ -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

View File

@@ -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',