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

Method _get_var

numpy/distutils/fcompiler/environment.py:52–75  ·  view source on GitHub ↗
(self, name, conf_desc)

Source from the content-addressed store, hash-verified

50 return var
51
52 def _get_var(self, name, conf_desc):
53 hook, envvar, confvar, convert, append = conf_desc
54 if convert is None:
55 convert = lambda x: x
56 var = self._hook_handler(name, hook)
57 if envvar is not None:
58 envvar_contents = os.environ.get(envvar)
59 if envvar_contents is not None:
60 envvar_contents = convert(envvar_contents)
61 if var and append:
62 if os.environ.get('NPY_DISTUTILS_APPEND_FLAGS', '1') == '1':
63 var.extend(envvar_contents)
64 else:
65 # NPY_DISTUTILS_APPEND_FLAGS was explicitly set to 0
66 # to keep old (overwrite flags rather than append to
67 # them) behavior
68 var = envvar_contents
69 else:
70 var = envvar_contents
71 if confvar is not None and self._conf:
72 if confvar in self._conf:
73 source, confvar_contents = self._conf[confvar]
74 var = convert(confvar_contents)
75 return var
76
77
78 def clone(self, hook_handler):

Callers 2

__getattr__Method · 0.95
getMethod · 0.95

Calls 2

convertFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected