Skip to content

Commit 04057b9

Browse files
committed
1.20.6 version bump and minor fixes
1 parent 23fb7dc commit 04057b9

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

UnityPy/UnityPyBoost.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from __future__ import annotations
2-
from typing import Union, TYPE_CHECKING, Literal, Optional, List, Any
2+
3+
from typing import TYPE_CHECKING, Any, List, Optional, Union
34

45
if TYPE_CHECKING:
5-
from .files.SerializedFile import SerializedFile
66
from .classes import Object
7+
from .files.SerializedFile import SerializedFile
78

89
def unpack_vertexdata(
910
data: Union[bytes, bytearray],
@@ -17,7 +18,7 @@ def unpack_vertexdata(
1718
def read_typetree(
1819
data: Union[bytes, bytearray],
1920
node: TypeTreeNode,
20-
endian: Literal["<", ">"],
21+
endian: Union["<", ">"],
2122
as_dict: bool,
2223
assetsfile: SerializedFile,
2324
classes: dict,

UnityPy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.20.5"
1+
__version__ = "1.20.6"
22

33
from .environment import Environment as Environment
44
from .helpers.ArchiveStorageManager import (

UnityPy/classes/UnknownObject.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ def format_value(v):
2323
return vstr[:97] + "..."
2424
return vstr
2525

26-
return f"<UnknownObject<{self.get_type()}> {', '.join(
27-
f'{k}={format_value(v)}' for k, v in self.__dict__.items() if k != '__node__'
28-
)}>"
26+
inner_str = ", ".join(
27+
f"{k}={format_value(v)}"
28+
for k, v in self.__dict__.items()
29+
if k != "__node__"
30+
)
31+
32+
return f"<UnknownObject<{self.get_type()}> {inner_str}>"

tests/test_typetree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import math
33
import os
44
import random
5-
from typing import List, Literal, Tuple, TypeVar
5+
from typing import List, Tuple, TypeVar, Union, Type
66

77
import psutil
88

@@ -73,7 +73,7 @@ def generate_dummy_node(typ: str, name: str = ""):
7373

7474
def generate_sample_data(
7575
u_type: List[str],
76-
py_typ: Literal[int, float, str],
76+
py_typ: Type[Union[int, float, str]],
7777
bounds: Tuple[T, T],
7878
count: int = 10,
7979
) -> List[T]:

0 commit comments

Comments
 (0)