Skip to content

Commit

Permalink
[Build] Remove .exe suffix on windows
Browse files Browse the repository at this point in the history
Windows executable will have .exe suffix.
It will cause illegal python code `def flat.exe():` generated.
This change fix the issue by remove the suffix.

For pytorch#4661
  • Loading branch information
python3kgae committed Aug 23, 2024
1 parent 11e8ed3 commit 5822c59
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build/pip_data_bin_init.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def _find_executable_files_under(dir):
for filename in os.listdir(dir):
filepath = os.path.join(dir, filename)
if os.path.isfile(filepath) and os.access(filepath, os.X_OK):
bin_names.append(filename)
# Remove .exe suffix on windows.
filename_without_ext = os.path.splitext(filename)[0]
bin_names.append(filename_without_ext)
return bin_names

# The list of binaries to create wrapper functions for.
Expand Down

0 comments on commit 5822c59

Please sign in to comment.