Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 9307ef2

Browse files
committed
do not use the python3.7+ text= in run()
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
1 parent 1e728ac commit 9307ef2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sage/features/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def package_systems():
373373
# Try to use scripts from SAGE_ROOT (or an installation of sage_bootstrap)
374374
# to obtain system package advice.
375375
try:
376-
proc = run('sage-guess-package-system', shell=True, stdout=PIPE, stderr=PIPE, text=True, check=True)
376+
proc = run('sage-guess-package-system', shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=True)
377377
_cache_package_systems = [PackageSystem(proc.stdout.strip())]
378378
except CalledProcessError:
379379
pass
@@ -440,11 +440,11 @@ def _spkg_installation_hint(self, spkgs, prompt, feature):
440440
system = self.name
441441
try:
442442
proc = run(f'sage-get-system-packages {system} {spkgs}',
443-
shell=True, stdout=PIPE, stderr=PIPE, text=True, check=True)
443+
shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=True)
444444
system_packages = proc.stdout.strip()
445445
print_sys = f'sage-print-system-package-command {system} --verbose --sudo --prompt="{prompt}"'
446446
command = f'{print_sys} update && {print_sys} install {system_packages}'
447-
proc = run(command, shell=True, stdout=PIPE, stderr=PIPE, text=True, check=True)
447+
proc = run(command, shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=True)
448448
command = proc.stdout.strip()
449449
if command:
450450
lines.append(f'To install {feature} using the {system} package manager, you can try to run:')

0 commit comments

Comments
 (0)