From c7829927118ae4f5608ce99b2bf17d7d90c49754 Mon Sep 17 00:00:00 2001 From: simonmicro Date: Sun, 18 Jun 2023 12:40:12 +0200 Subject: [PATCH] Fixed build script for Python 3.8 --- scripts/build/prebuild_assets.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build/prebuild_assets.py b/scripts/build/prebuild_assets.py index 4edd67ade..ad3cc6180 100755 --- a/scripts/build/prebuild_assets.py +++ b/scripts/build/prebuild_assets.py @@ -28,7 +28,13 @@ def createAssets(srcPath, assPath, convertAssetToSourceCode, force): # Clear the assets folder as needed for subPath, _, filenames in os.walk(assPath): for file in filenames: - fileStripped = file.removesuffix('.h').removesuffix('.gz') + # fileStripped = file.removesuffix('.h').removesuffix('.gz') + # the above line is only available in python 3.9, so we use the following instead: + fileStripped = file + if (split := os.path.splitext(file))[1] == '.h': + fileStripped = split[0] + if (split := os.path.splitext(file))[1] == '.gz': + fileStripped = split[0] assFile = os.path.join(subPath, fileStripped) path = os.path.relpath(assFile, assPath) if path not in srcFiles: