MCPcopy Index your code
hub / github.com/python/cpython / _check_not_importing_main

Function _check_not_importing_main

Lib/multiprocessing/spawn.py:138–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136
137
138def _check_not_importing_main():
139 if getattr(process.current_process(), '_inheriting', False):
140 raise RuntimeError('''
141 An attempt has been made to start a new process before the
142 current process has finished its bootstrapping phase.
143
144 This probably means that you are not using fork to start your
145 child processes and you have forgotten to use the proper idiom
146 in the main module:
147
148 if __name__ == '__main__':
149 freeze_support()
150 ...
151
152 The "freeze_support()" line can be omitted if the program
153 is not going to be frozen to produce an executable.
154
155 To fix this issue, refer to the "Safe importing of main module"
156 section in https://docs.python.org/3/library/multiprocessing.html
157 ''')
158
159
160def get_preparation_data(name):

Callers 1

get_preparation_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…