1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-06-30 06:35:24 +00:00

Added distribution info to toot diag (iff using Python 3.10+)

This commit is contained in:
Daniel Schwarz 2024-06-18 17:18:36 -04:00
parent b088ce9585
commit abe17695ba

View File

@ -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:"))