Commit 17be514d authored by Steve Dower's avatar Steve Dower

Closes #23437: Make user scripts directory versioned on Windows (patch by pmoore)

parent a9076d65
...@@ -361,7 +361,7 @@ And here are the values used on Windows: ...@@ -361,7 +361,7 @@ And here are the values used on Windows:
Type of file Installation directory Type of file Installation directory
=============== =========================================================== =============== ===========================================================
modules :file:`{userbase}\\Python{XY}\\site-packages` modules :file:`{userbase}\\Python{XY}\\site-packages`
scripts :file:`{userbase}\\Scripts` scripts :file:`{userbase}\\Python{XY}\\Scripts`
data :file:`{userbase}` data :file:`{userbase}`
C headers :file:`{userbase}\\Python{XY}\\Include\\{distname}` C headers :file:`{userbase}\\Python{XY}\\Include\\{distname}`
=============== =========================================================== =============== ===========================================================
......
...@@ -51,7 +51,7 @@ if HAS_USER_SITE: ...@@ -51,7 +51,7 @@ if HAS_USER_SITE:
'purelib': '$usersite', 'purelib': '$usersite',
'platlib': '$usersite', 'platlib': '$usersite',
'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name',
'scripts': '$userbase/Scripts', 'scripts': '$userbase/Python$py_version_nodot/Scripts',
'data' : '$userbase', 'data' : '$userbase',
} }
......
...@@ -57,7 +57,7 @@ _INSTALL_SCHEMES = { ...@@ -57,7 +57,7 @@ _INSTALL_SCHEMES = {
'purelib': '{userbase}/Python{py_version_nodot}/site-packages', 'purelib': '{userbase}/Python{py_version_nodot}/site-packages',
'platlib': '{userbase}/Python{py_version_nodot}/site-packages', 'platlib': '{userbase}/Python{py_version_nodot}/site-packages',
'include': '{userbase}/Python{py_version_nodot}/Include', 'include': '{userbase}/Python{py_version_nodot}/Include',
'scripts': '{userbase}/Scripts', 'scripts': '{userbase}/Python{py_version_nodot}/Scripts',
'data': '{userbase}', 'data': '{userbase}',
}, },
'posix_user': { 'posix_user': {
......
...@@ -22,7 +22,8 @@ def modify(): ...@@ -22,7 +22,8 @@ def modify():
scripts = os.path.join(pythonpath, "Scripts") scripts = os.path.join(pythonpath, "Scripts")
appdata = os.environ["APPDATA"] appdata = os.environ["APPDATA"]
if hasattr(site, "USER_SITE"): 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") userscripts = os.path.join(userpath, "Scripts")
else: else:
userscripts = None userscripts = None
......
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