Commit 372be090 authored by Jason R. Coombs's avatar Jason R. Coombs

Warn when scripts are installed but PATHEXT isn't set

--HG--
extra : histedit_source : a1c329f92ee71a707955e352b63987af9de6e120
parent 78baec33
......@@ -23,6 +23,7 @@ import stat
import random
import platform
import textwrap
import warnings
from glob import glob
from distutils import log, dir_util
......@@ -1845,6 +1846,9 @@ class WindowsScriptWriter(ScriptWriter):
def _get_script_args(cls, type_, name, header, script_text):
"For Windows, add a .py extension"
ext = dict(console='.pya', gui='.pyw')[type_]
if ext not in os.environ['PATHEXT'].lower().split(';'):
warnings.warn("%s not listed in PATHEXT; scripts will not be "
"recognized as executables." % ext, UserWarning)
old = ['.pya', '.py', '-script.py', '.pyc', '.pyo', '.pyw', '.exe']
old.remove(ext)
header = cls._adjust_header(type_, header)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment