MCPcopy Create free account
hub / github.com/numpy/numpy / __init__

Method __init__

numpy/distutils/cpuinfo.py:103–124  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

101 info = None
102
103 def __init__(self):
104 if self.info is not None:
105 return
106 info = [ {} ]
107 ok, output = getoutput('uname -m')
108 if ok:
109 info[0]['uname_m'] = output.strip()
110 try:
111 fo = open('/proc/cpuinfo')
112 except OSError as e:
113 warnings.warn(str(e), UserWarning, stacklevel=2)
114 else:
115 for line in fo:
116 name_value = [s.strip() for s in line.split(':', 1)]
117 if len(name_value) != 2:
118 continue
119 name, value = name_value
120 if not info or name in info[-1]: # next processor
121 info.append({})
122 info[-1][name] = value
123 fo.close()
124 self.__class__.info = info
125
126 def _not_impl(self): pass
127

Callers

nothing calls this directly

Calls 6

getoutputFunction · 0.85
openFunction · 0.85
stripMethod · 0.80
warnMethod · 0.80
splitMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected