Skip to content

Commit b46cdf5

Browse files
committed
remove typing.Self - compatiblity problem with <3.12
1 parent 70ff687 commit b46cdf5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎UnityPy/classes/Object.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from __future__ import annotations
22
from abc import ABC, ABCMeta
3-
from typing import TYPE_CHECKING, Dict, Any, Optional, Self
3+
from typing import TYPE_CHECKING, Dict, Any, Optional
44

55
if TYPE_CHECKING:
66
from ..files.ObjectReader import ObjectReader
77
from ..files.SerializedFile import SerializedFile
88

99

1010
class Object(ABC, metaclass=ABCMeta):
11-
object_reader: Optional[ObjectReader[Self]] = None
11+
object_reader: Optional[ObjectReader] = None
1212

1313
def __init__(self, **kwargs: Dict[str, Any]) -> None:
1414
self.__dict__.update(**kwargs)

‎UnityPy/classes/math.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
from attrs import define
8-
from typing import Self, TypeAlias
8+
from typing import TypeAlias
99

1010

1111
@define(slots=True)
@@ -93,7 +93,7 @@ class ColorRGBA:
9393

9494
def __new__(
9595
cls, r: float = 0, g: float = 0, b: float = 0, a: float = 1, rgba: int = -1
96-
) -> Self:
96+
) -> "ColorRGBA":
9797
obj = super().__new__(cls)
9898
if rgba != -1:
9999
r = ((rgba >> 24) & 0xFF) / 255

0 commit comments

Comments
 (0)