From 372be090c5acab13a5cc88893c50c09a7b7ec56e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 13 Aug 2013 23:48:42 -0400 Subject: Warn when scripts are installed but PATHEXT isn't set --HG-- extra : histedit_source : a1c329f92ee71a707955e352b63987af9de6e120 --- setuptools/command/easy_install.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 53f2e7cf..a0171e3d 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -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) -- cgit v1.2.1