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

Function _convert_str_to_file

numpy/testing/_private/extbuild.py:113–120  ·  view source on GitHub ↗

Helper function to create a file ``source.c`` in `dirname` that contains the string in `source`. Returns the file name

(source, dirname)

Source from the content-addressed store, hash-verified

111
112
113def _convert_str_to_file(source, dirname):
114 """Helper function to create a file ``source.c`` in `dirname` that contains
115 the string in `source`. Returns the file name
116 """
117 filename = dirname / 'source.c'
118 with filename.open('w') as f:
119 f.write(str(source))
120 return filename
121
122
123def _make_methods(functions, modname):

Callers 1

compile_extension_moduleFunction · 0.85

Calls 2

openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected