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 <matt.ryan@nominum.com>
Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com>
This commit is contained in:
Matthew Ryan 2023-03-15 03:47:58 -07:00 committed by GitHub
parent 6c39999b40
commit c5eb29860e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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,