diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index eab82c3631f..cc230dd2297 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -199,11 +199,19 @@ def collect_os(info_add): ) copy_attributes(info_add, os, 'os.%s', attributes, formatter=format_attr) - call_func(info_add, 'os.getcwd', os, 'getcwd') - - call_func(info_add, 'os.getuid', os, 'getuid') - call_func(info_add, 'os.getgid', os, 'getgid') - call_func(info_add, 'os.uname', os, 'uname') + for func in ( + 'cpu_count', + 'getcwd', + 'getegid', + 'geteuid', + 'getgid', + 'getloadavg', + 'getresgid', + 'getresuid', + 'getuid', + 'uname', + ): + call_func(info_add, 'os.%s' % func, os, func) def format_groups(groups): return ', '.join(map(str, groups)) @@ -220,9 +228,6 @@ def collect_os(info_add): else: info_add("os.login", login) - call_func(info_add, 'os.cpu_count', os, 'cpu_count') - call_func(info_add, 'os.getloadavg', os, 'getloadavg') - # Environment variables used by the stdlib and tests. Don't log the full # environment: filter to list to not leak sensitive information. # @@ -303,7 +308,7 @@ def collect_os(info_add): if hasattr(os, 'umask'): mask = os.umask(0) os.umask(mask) - info_add("os.umask", '%03o' % mask) + info_add("os.umask", '0o%03o' % mask) def collect_pwd(info_add):