mirror of
https://github.com/ihabunek/toot
synced 2025-01-09 00:03:15 +01:00
Added distribution info to toot diag (iff using Python 3.10+)
This commit is contained in:
parent
b088ce9585
commit
abe17695ba
@ -329,12 +329,14 @@ def print_diags(include_files: bool):
|
|||||||
import platform
|
import platform
|
||||||
click.echo(f'{green(f"Platform:")} {platform.platform()}')
|
click.echo(f'{green(f"Platform:")} {platform.platform()}')
|
||||||
|
|
||||||
# Uncomment this when we move to minimum Python version 3.10
|
# print distro - only call if available (python 3.10+)
|
||||||
# try:
|
fd_os_release = getattr(platform, "freedesktop_os_release", None) # novermin
|
||||||
# name = platform.freedesktop_os_release()['PRETTY_NAME']
|
if callable(fd_os_release): # novermin
|
||||||
# click.echo(f'{green(f"Distro:")} {name}')
|
try:
|
||||||
# except: # noqa
|
name = platform.freedesktop_os_release()['PRETTY_NAME']
|
||||||
# pass
|
click.echo(f'{green(f"Distro:")} {name}')
|
||||||
|
except: # noqa
|
||||||
|
pass
|
||||||
|
|
||||||
click.echo(f'{green(f"Python version:")} {platform.python_version()}')
|
click.echo(f'{green(f"Python version:")} {platform.python_version()}')
|
||||||
click.echo(green("Dependency versions:"))
|
click.echo(green("Dependency versions:"))
|
||||||
|
Loading…
Reference in New Issue
Block a user