Skip to content

Commit d160f38

Browse files
committed
AudioClipConverter - pre 3.12 patch
1 parent cfc2f6a commit d160f38

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎UnityPy/export/AudioClipConverter.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,15 @@ def import_pyfmodex():
7070
# hotfix ctypes for pyfmodex for non windows systems
7171
ctypes.windll = None
7272

73+
# behavior changed in python 3.12
7374
fp = path(f"UnityPy.lib.FMOD.{system}.{arch}", libname)
7475
if hasattr(fp, "args"):
7576
# some newer version doesn't directly return a path, but instead a generator
7677
fp = fp.args[0]
78+
if not isinstance(fp, str):
79+
fp = fp.absolute()
7780

78-
os.environ["PYFMODEX_DLL_PATH"] = str(fp.absolute())
81+
os.environ["PYFMODEX_DLL_PATH"] = str(fp)
7982

8083
import pyfmodex
8184

0 commit comments

Comments
 (0)