Skip to content

Commit 89b3607

Browse files
Mathew Robinsonevergreen
authored andcommitted
SERVER-42911 Pass %APPDATA% into ENV for python subprocesses on Windows
1 parent 3693ad5 commit 89b3607

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

SConstruct

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,15 @@ if env.TargetOSIs('posix'):
19221922
except KeyError:
19231923
pass
19241924

1925+
# Python uses APPDATA to determine the location of user installed
1926+
# site-packages. If we do not pass this variable down to Python
1927+
# subprocesses then anything installed with `pip install --user`
1928+
# will be inaccessible leading to import errors.
1929+
if env.TargetOSIs('windows'):
1930+
appdata = os.getenv('APPDATA', None)
1931+
if appdata is not None:
1932+
env['ENV']['APPDATA'] = appdata
1933+
19251934
if env.TargetOSIs('linux') and has_option( "gcov" ):
19261935
env.Append( CCFLAGS=["-fprofile-arcs", "-ftest-coverage", "-fprofile-update=single"] )
19271936
env.Append( LINKFLAGS=["-fprofile-arcs", "-ftest-coverage", "-fprofile-update=single"] )

0 commit comments

Comments
 (0)