Skip to content

Commit

Permalink
Fixed build script for Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmicro committed Jun 18, 2023
1 parent 901f141 commit c782992
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/build/prebuild_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c782992

Please sign in to comment.