Check whether this is a fake forked process in a frozen executable. If so then run code specified by commandline and exit.
(self)
| 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 |