Skip to content

Commit

Permalink
use runpy for bootstrap script execution
Browse files Browse the repository at this point in the history
  • Loading branch information
ronpandolfi committed May 10, 2023
1 parent 7a8f131 commit 4c9f244
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tsuchinoko/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import asyncio
import importlib
import sys
import runpy

from ._version import get_versions

Expand Down Expand Up @@ -50,4 +51,4 @@ def bootstrap(path, args):
"""A pyinstaller trick to allow launch of python scripts from built exes"""
print(path)
sys.argv.pop(0)
exec(f"""__name__='__main__'; print(sys.argv); {open(path).read()}""",)
runpy.run_path(path, {}, "__main__")

0 comments on commit 4c9f244

Please sign in to comment.