Skip to content

Commit 56b4ad9

Browse files
authored
Guard script wrapper entrypoint import with if __main__ (#242)
1 parent fe57366 commit 56b4ad9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

distlib/scripts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
SCRIPT_TEMPLATE = r'''# -*- coding: utf-8 -*-
4343
import re
4444
import sys
45-
from %(module)s import %(import_name)s
4645
if __name__ == '__main__':
46+
from %(module)s import %(import_name)s
4747
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
4848
sys.exit(%(func)s())
4949
'''

0 commit comments

Comments
 (0)