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 47ae38f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions 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,10 +33,12 @@ 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]
return popen_text(venv.run)(cmd, **kwargs)
if platform.system() == 'Windows':
env['SYSTEMROOT'] = os.environ['SYSTEMROOT']
return popen_text(venv.run)(cmd, env=env, **kwargs)


def test_distutils_stdlib(venv):
Expand Down

0 comments on commit 47ae38f

Please sign in to comment.