Skip to content

Commit

Permalink
Update scripts for Py3 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Deledrius committed May 18, 2020
1 parent 178e44d commit 1324efc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def create_resource_dat(resfilepath, inrespath):
datFile.write(struct.pack("<I",len(resourceList)))
for res in resourceList:
with open(res, "rb") as resFile:
name = os.path.basename(res)
name = os.path.basename(res).encode("utf-8")
datFile.write(struct.pack("<I", len(name)))
datFile.write(name)
datFile.write(struct.pack("<I", os.path.getsize(res)))
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindPythonModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(find_python_module module)
# A module's location is usually a directory, but for binary modules
# it's a .so file.
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
"import re, ${module}; print re.compile('/__init__.py.*').sub('',${module}.__file__)"
"import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))"
RESULT_VARIABLE _${module}_status
OUTPUT_VARIABLE _${module}_location
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down

0 comments on commit 1324efc

Please sign in to comment.