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

Method __init__

numpy/distutils/system_info.py:2747–2778  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2745 notfounderror = NumericNotFoundError
2746
2747 def __init__(self):
2748 include_dirs = []
2749 try:
2750 module = __import__(self.modulename)
2751 prefix = []
2752 for name in module.__file__.split(os.sep):
2753 if name == 'lib':
2754 break
2755 prefix.append(name)
2756
2757 # Ask numpy for its own include path before attempting
2758 # anything else
2759 try:
2760 include_dirs.append(getattr(module, 'get_include')())
2761 except AttributeError:
2762 pass
2763
2764 include_dirs.append(sysconfig.get_path('include'))
2765 except ImportError:
2766 pass
2767 py_incl_dir = sysconfig.get_path('include')
2768 include_dirs.append(py_incl_dir)
2769 py_pincl_dir = sysconfig.get_path('platinclude')
2770 if py_pincl_dir not in include_dirs:
2771 include_dirs.append(py_pincl_dir)
2772 for d in default_include_dirs:
2773 d = os.path.join(d, os.path.basename(py_incl_dir))
2774 if d not in include_dirs:
2775 include_dirs.append(d)
2776 system_info.__init__(self,
2777 default_lib_dirs=[],
2778 default_include_dirs=include_dirs)
2779
2780 def calc_info(self):
2781 try:

Callers

nothing calls this directly

Calls 3

splitMethod · 0.45
joinMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected