(run_lambda)
| 437 | |
| 438 | |
| 439 | def get_os(run_lambda): |
| 440 | from platform import machine |
| 441 | |
| 442 | platform = get_platform() |
| 443 | |
| 444 | if platform == "win32" or platform == "cygwin": |
| 445 | return get_windows_version(run_lambda) |
| 446 | |
| 447 | if platform == "darwin": |
| 448 | version = get_mac_version(run_lambda) |
| 449 | if version is None: |
| 450 | return None |
| 451 | return "macOS {} ({})".format(version, machine()) |
| 452 | |
| 453 | if platform == "linux": |
| 454 | # Ubuntu/Debian based |
| 455 | desc = get_lsb_version(run_lambda) |
| 456 | if desc is not None: |
| 457 | return "{} ({})".format(desc, machine()) |
| 458 | |
| 459 | # Try reading /etc/*-release |
| 460 | desc = check_release_file(run_lambda) |
| 461 | if desc is not None: |
| 462 | return "{} ({})".format(desc, machine()) |
| 463 | |
| 464 | return "{} ({})".format(platform, machine()) |
| 465 | |
| 466 | # Unknown platform |
| 467 | return platform |
| 468 | |
| 469 | |
| 470 | def get_python_platform(): |
no test coverage detected