summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-02-14 17:50:59 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2015-02-14 17:50:59 (GMT)
commit17be514d0a9a391461fbbdb06332d7b2b8273374 (patch)
tree0e5e419b457fe42ab89eca5e6440a99bbb1d399f
parenta9076d655134386ddc7f9fca40c926a102f35b84 (diff)
downloadcpython-17be514d0a9a391461fbbdb06332d7b2b8273374.zip
cpython-17be514d0a9a391461fbbdb06332d7b2b8273374.tar.gz
cpython-17be514d0a9a391461fbbdb06332d7b2b8273374.tar.bz2
Closes #23437: Make user scripts directory versioned on Windows (patch by pmoore)
-rw-r--r--Doc/install/index.rst2
-rw-r--r--Lib/distutils/command/install.py2
-rw-r--r--Lib/sysconfig.py2
-rw-r--r--Tools/scripts/win_add2path.py3
4 files changed, 5 insertions, 4 deletions
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
index 8f3ad72..876f350 100644
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -361,7 +361,7 @@ And here are the values used on Windows:
Type of file Installation directory
=============== ===========================================================
modules :file:`{userbase}\\Python{XY}\\site-packages`
-scripts :file:`{userbase}\\Scripts`
+scripts :file:`{userbase}\\Python{XY}\\Scripts`
data :file:`{userbase}`
C headers :file:`{userbase}\\Python{XY}\\Include\\{distname}`
=============== ===========================================================
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index d768dc5..67db007 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -51,7 +51,7 @@ if HAS_USER_SITE:
'purelib': '$usersite',
'platlib': '$usersite',
'headers': '$userbase/Python$py_version_nodot/Include/$dist_name',
- 'scripts': '$userbase/Scripts',
+ 'scripts': '$userbase/Python$py_version_nodot/Scripts',
'data' : '$userbase',
}
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index c5f541b..137932e 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -57,7 +57,7 @@ _INSTALL_SCHEMES = {
'purelib': '{userbase}/Python{py_version_nodot}/site-packages',
'platlib': '{userbase}/Python{py_version_nodot}/site-packages',
'include': '{userbase}/Python{py_version_nodot}/Include',
- 'scripts': '{userbase}/Scripts',
+ 'scripts': '{userbase}/Python{py_version_nodot}/Scripts',
'data': '{userbase}',
},
'posix_user': {
diff --git a/Tools/scripts/win_add2path.py b/Tools/scripts/win_add2path.py
index c85bea5..1c9aedc 100644
--- a/Tools/scripts/win_add2path.py
+++ b/Tools/scripts/win_add2path.py
@@ -22,7 +22,8 @@ def modify():
scripts = os.path.join(pythonpath, "Scripts")
appdata = os.environ["APPDATA"]
if hasattr(site, "USER_SITE"):
- userpath = site.USER_SITE.replace(appdata, "%APPDATA%")
+ usersite = site.USER_SITE.replace(appdata, "%APPDATA%")
+ userpath = os.path.dirname(usersite)
userscripts = os.path.join(userpath, "Scripts")
else:
userscripts = None