Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
building: add .py suffix to entry-point scripts without suffix
If the entry-point script has no suffix, append the `.py` suffix to the filename passed to the `compile` function when byte-compiling the script for collection. This ensures that the entry-point script filename never coincides with executable filename, especially in POSIX builds, where executables have no suffix either (and their name is based on the entry-point script basename by default). Entry-point script having the same filename as the executable causes issues when `traceback` (and `linecache`) try to access source code for it, an in the process end up reading the executable file if it happens to be in the current working directory.
- Loading branch information