Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More bugfixes
* Fix ver command
* Fix kern.hv_vmm_present test
* Log also IMAGE_OS_VERSION env var.
* Remove debug messages
  • Loading branch information
vstinner committed Jun 30, 2026
commit f60c855384803f511fc3c59a15b70e25d74a4b79
9 changes: 5 additions & 4 deletions Lib/test/pythoninfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ def format_groups(groups):
"HOMEDRIVE",
"HOMEPATH",
"IDLESTARTUP",
"IMAGE_OS_VERSION",
"IPHONEOS_DEPLOYMENT_TARGET",
"LANG",
"LDFLAGS",
Expand Down Expand Up @@ -466,11 +467,9 @@ def run_command(cmd, check=True, **kwargs):
return ''

# Strip trailing spaces and newlines
print(f"DEBUG: Command {cmd_str} succeeded: {stdout!r}")
stdout = stdout.rstrip()
return stdout
except FileNotFoundError as exc:
print(f"DEBUG: Command {cmd_str} failed with: {exc!r}")
except FileNotFoundError:
return ''
except OSError as exc:
print(f"Command {cmd_str} failed with: {exc!r}")
Expand Down Expand Up @@ -1025,6 +1024,8 @@ def collect_windows(info_add):

# windows.ver: "ver" command
output = run_command(["ver"], shell=True)
# "ver" output starts with an empty line: remove it
output = output.strip()
if output:
first_line = output.splitlines()[0]
if first_line:
Expand Down Expand Up @@ -1157,7 +1158,7 @@ def detect_virt():
return container

if APPLE:
hv_vmm_present = run_command(['sysctl', 'kern.hv_vmm_present'])
hv_vmm_present = run_command(['sysctl', '-n', 'kern.hv_vmm_present'])
if hv_vmm_present == '1':
return 'run in a VM (kern.hv_vmm_present is 1)'

Expand Down
Loading