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

Method freeze_support

Lib/multiprocessing/context.py:144–156  ·  view source on GitHub ↗

Check whether this is a fake forked process in a frozen executable. If so then run code specified by commandline and exit.

(self)

Source from the content-addressed store, hash-verified

142 ctx=self.get_context())
143
144 def freeze_support(self):
145 '''Check whether this is a fake forked process in a frozen executable.
146 If so then run code specified by commandline and exit.
147 '''
148 # gh-140814: allow_none=True avoids locking in the default start
149 # method, which would cause a later set_start_method() to fail.
150 # None is safe to pass through: spawn.freeze_support()
151 # independently detects whether this process is a spawned
152 # child, so the start method check here is only an optimization.
153 if (getattr(sys, 'frozen', False)
154 and self.get_start_method(allow_none=True) in ('spawn', None)):
155 from .spawn import freeze_support
156 freeze_support()
157
158 def get_logger(self):
159 '''Return package logger -- if it does not already exist then

Callers 2

mp_pool.pyFile · 0.80

Calls 2

get_start_methodMethod · 0.95
freeze_supportFunction · 0.70

Tested by 1