Skip to content

Commit

Permalink
On Windows, SYSTEMROOT must be supplied.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 8, 2020
1 parent 41deeb7 commit 177cd6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion setuptools/tests/test_distutils_adoption.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
import functools
import subprocess
import platform

import pytest
import jaraco.envs
Expand Down Expand Up @@ -32,9 +33,11 @@ def popen_text(call):
if sys.version_info < (3, 7) else functools.partial(call, text=True)


def find_distutils(venv, imports='distutils', **kwargs):
def find_distutils(venv, imports='distutils', env=None, **kwargs):
py_cmd = 'import {imports}; print(distutils.__file__)'.format(**locals())
cmd = ['python', '-c', py_cmd]
if platform.system() == 'Windows':
env['SYSTEMROOT'] = os.environ['SYSTEMROOT']
return popen_text(venv.run)(cmd, **kwargs)


Expand Down

0 comments on commit 177cd6d

Please sign in to comment.