From 6281bd0917882b930d5923d76cc72ff4ee5a7695 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 8 Aug 2020 12:15:13 -0400 Subject: Support Python 3.5 and 3.6 in the tests. --- setuptools/tests/test_distutils_adoption.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/setuptools/tests/test_distutils_adoption.py b/setuptools/tests/test_distutils_adoption.py index f4c7072d..a945a69f 100644 --- a/setuptools/tests/test_distutils_adoption.py +++ b/setuptools/tests/test_distutils_adoption.py @@ -1,7 +1,18 @@ import os +import sys +import functools + import pytest +def popen_text(call): + """ + Augment the Popen call with the parameters to ensure unicode text. + """ + return functools.partial(call, universal_newlines=True) \ + if sys.version_info < (3, 7) else functools.partial(call, text=True) + + @pytest.fixture def env(virtualenv): virtualenv.run(['pip', 'uninstall', '-y', 'setuptools']) @@ -12,7 +23,7 @@ def env(virtualenv): def find_distutils(env, imports='distutils'): py_cmd = 'import {imports}; print(distutils.__file__)'.format(**locals()) cmd = ['python', '-c', py_cmd] - return env.run(cmd, capture=True, text=True) + return popen_text(env.run)(cmd, capture=True) def test_distutils_stdlib(env): -- cgit v1.2.3