Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
do not use the python3.7+ text= in run()
Browse files Browse the repository at this point in the history
after #30740, text=True is still there, in the calls to run(),
and also not supported by Python 3.6,
cf.://docs.python.org/3/library/subprocess.html

Changed in version 3.7: Added the text parameter,
as a more understandable alias of universal_newlines.
Added the capture_output parameter.

as reported in https://groups.google.com/d/msgid/sage-release/8404a7d9-b906-4301-b891-59733da482cen%40googlegroups.com
  • Loading branch information
dimpase committed Oct 13, 2020
1 parent 1e728ac commit 9307ef2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sage/features/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def package_systems():
# Try to use scripts from SAGE_ROOT (or an installation of sage_bootstrap)
# to obtain system package advice.
try:
proc = run('sage-guess-package-system', shell=True, stdout=PIPE, stderr=PIPE, text=True, check=True)
proc = run('sage-guess-package-system', shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=True)
_cache_package_systems = [PackageSystem(proc.stdout.strip())]
except CalledProcessError:
pass
Expand Down Expand Up @@ -440,11 +440,11 @@ def _spkg_installation_hint(self, spkgs, prompt, feature):
system = self.name
try:
proc = run(f'sage-get-system-packages {system} {spkgs}',
shell=True, stdout=PIPE, stderr=PIPE, text=True, check=True)
shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=True)
system_packages = proc.stdout.strip()
print_sys = f'sage-print-system-package-command {system} --verbose --sudo --prompt="{prompt}"'
command = f'{print_sys} update && {print_sys} install {system_packages}'
proc = run(command, shell=True, stdout=PIPE, stderr=PIPE, text=True, check=True)
proc = run(command, shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=True)
command = proc.stdout.strip()
if command:
lines.append(f'To install {feature} using the {system} package manager, you can try to run:')
Expand Down

0 comments on commit 9307ef2

Please sign in to comment.