mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-23 22:51:35 +00:00
remove platform.uname() call, fixes #3732
This commit is contained in:
parent
ad7b687911
commit
4f45eb660a
1 changed files with 17 additions and 18 deletions
|
@ -1602,26 +1602,25 @@ def finish(self):
|
||||||
|
|
||||||
|
|
||||||
def sysinfo():
|
def sysinfo():
|
||||||
orig_env = os.environ
|
python_implementation = platform.python_implementation()
|
||||||
cleaned_env = prepare_subprocess_env(system=True)
|
python_version = platform.python_version()
|
||||||
linux_distribution = None
|
# platform.uname() does a shell call internally to get processor info,
|
||||||
|
# creating #3732 issue, so rather use os.uname().
|
||||||
try:
|
try:
|
||||||
# some platform calls internally run /bin/sh, so run them within a cleaned env,
|
uname = os.uname()
|
||||||
# so that sh doesn't use pyinstaller env libs, but system libs, see #3732
|
except AttributeError:
|
||||||
os.environ = cleaned_env
|
uname = None
|
||||||
uname = platform.uname()
|
if sys.platform.startswith('linux'):
|
||||||
python_implementation = platform.python_implementation()
|
try:
|
||||||
python_version = platform.python_version()
|
linux_distribution = platform.linux_distribution()
|
||||||
if sys.platform.startswith('linux'):
|
except:
|
||||||
try:
|
# platform.linux_distribution() is deprecated since py 3.5 and removed in 3.7.
|
||||||
linux_distribution = platform.linux_distribution()
|
linux_distribution = ('Unknown Linux', '', '')
|
||||||
except:
|
else:
|
||||||
# platform.linux_distribution() is deprecated since py 3.5 and removed in 3.7.
|
linux_distribution = None
|
||||||
linux_distribution = ('Unknown Linux', '', '')
|
|
||||||
finally:
|
|
||||||
os.environ = orig_env
|
|
||||||
info = []
|
info = []
|
||||||
info.append('Platform: %s' % (' '.join(uname), ))
|
if uname is not None:
|
||||||
|
info.append('Platform: %s' % (' '.join(uname), ))
|
||||||
if linux_distribution is not None:
|
if linux_distribution is not None:
|
||||||
info.append('Linux: %s %s %s' % linux_distribution)
|
info.append('Linux: %s %s %s' % linux_distribution)
|
||||||
info.append('Borg: %s Python: %s %s' % (borg_version, python_implementation, python_version))
|
info.append('Borg: %s Python: %s %s' % (borg_version, python_implementation, python_version))
|
||||||
|
|
Loading…
Reference in a new issue