Ticket #3633: hostinfo.patch
| File hostinfo.patch, 0.9 kB (added by yi, 5 months ago) |
|---|
-
a/sage/dsage/misc/hostinfo.py
old new 15 15 # 16 16 # http://www.gnu.org/licenses/ 17 17 ############################################################################ 18 18 19 import os 20 import commands 21 19 22 20 23 class HostInfo(object): 21 24 """ … … 80 83 else: 81 84 host_info[key] = value.strip() 82 85 elif host_info['os'] == 'Darwin': 83 for line in os.popen('sysctl -a hw machdep').readlines():86 for line in commands.getoutput('sysctl -a hw machdep').split('\n'): 84 87 l = line.strip() 85 88 if '=' in l: 86 89 l = l.split('=')