Skip to content

Commit

Permalink
move sys.path setting up per review.
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Nov 8, 2024
1 parent 702e0b7 commit 7ad114f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/multiprocessing/forkserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ def ensure_running(self):
def main(listener_fd, alive_r, preload, main_path=None, sys_path=None):
'''Run forkserver.'''
if preload:
if sys_path is not None:
sys.path[:] = sys_path
if '__main__' in preload and main_path is not None:
process.current_process()._inheriting = True
try:
spawn.import_main_path(main_path)
finally:
del process.current_process()._inheriting
if sys_path is not None:
sys.path[:] = sys_path
for modname in preload:
try:
__import__(modname)
Expand Down

0 comments on commit 7ad114f

Please sign in to comment.