mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Simplify preload regression test using `__main__` With the fix for gh-126631 `__main__` modules can be preloaded and the regression test for gh-135335 can be simplified to just use a self-contained script rather than requiring a module. Note this assumes and implicitly tests that `__main__` is preloaded by default.
11 lines
291 B
Python
11 lines
291 B
Python
import multiprocessing
|
|
import sys
|
|
|
|
print(__name__, end='', file=sys.stderr)
|
|
print(__name__, end='', file=sys.stdout)
|
|
if __name__ == '__main__':
|
|
multiprocessing.set_start_method('forkserver')
|
|
for _ in range(2):
|
|
p = multiprocessing.Process()
|
|
p.start()
|
|
p.join()
|