From c5eb29860e63e5099d0802fc44ea756260e6775e Mon Sep 17 00:00:00 2001 From: Matthew Ryan <54719826+akamaryan@users.noreply.github.com> Date: Wed, 15 Mar 2023 03:47:58 -0700 Subject: [PATCH] Python 3.6 compatibility fix. (#8516) * Python 3.6 compatibility fix. The capture_output argument to subprocess.run() was not introduced until Python 3.7. Use stdout=subprocess.PIPE and stderr=subprocess.PIPE instead, which is equivalent. * Update pyproject.toml * Black --------- Co-authored-by: Matthew Ryan Co-authored-by: Paul Kehrer --- pyproject.toml | 3 ++- setup.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d79a4d314..6844bc096 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,8 @@ exclude_lines = [ [tool.ruff] # UP006: Minimum Python 3.9 # UP007, UP038: Minimum Python 3.10 -ignore = ['N818', 'UP006', 'UP007', 'UP038'] +# UP022: Minimum Python 3.7 +ignore = ['N818', 'UP006', 'UP007', 'UP038', 'UP022'] select = ['E', 'F', 'I', 'N', 'W', 'UP'] line-length = 79 diff --git a/setup.py b/setup.py index 2d084d1ef..e1adff269 100644 --- a/setup.py +++ b/setup.py @@ -101,7 +101,8 @@ except: # noqa: E722 # If for any reason `rustc --version` fails, silently ignore it rustc_output = subprocess.run( ["rustc", "--version"], - capture_output=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, timeout=0.5, encoding="utf8", check=True,