python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_fork1.cpython-312.opt-1.pyc

Αe8
dZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZejsejdGdde
ZdZed	k(rej$yy)
z.This test checks for correct fork() behavior.
N)ForkWait)supportz$test module requires working os.forkceZdZdZdZy)ForkTestc	tjdd	d	fd}tj|}|jj	d}tj}	|sZt}|k(rtj|nWtjdkDrtdtjdn#|j|j||		tj|tj y
#t"$rYy
wxYw#	tj|tj w#t"$rYwwxYwxYw)zFCheck fork() in main thread works while a subthread is doing an importzfake test modulepartialcompletectjtj<j	tjdtj<tjy)Ng{Gz?)impacquire_locksysmodulessettimesleeprelease_lock)complete_modulefake_module_nameimport_startedpartial_modulesC/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_fork1.pyimporterz9ForkTest.test_threaded_import_lock_fork.<locals>.importersQ,:CKK() JJt,;CKK())target*z Child encountered partial moduleexitcodeN)	threadingEventThreadstartwaitosfork
__import___exitrverboseprintjoin	wait_implkillsignalSIGKILLOSError)
selfrtrpidmrrrrs
      @@@@rtest_threaded_import_lock_forkz'ForkTest.test_threaded_import_lock_forks"*-"$	
H-		ggi	/0'HHX&*@AHHQKsX6
V^^,


V^^,

sC4A?D(4$D	D%$D%(E*$EE	EEEEcHdfd}tdD]
}||y)zJCheck fork() in main thread works while the main thread is doing an importrcd}d}		t|D]}tj|dz
}tj}|}t|D]}tj
	|rtjj|y#t|D]}tj
wxYw#t$r7|r3tjdkDrtdtjdwxYw)NrFrzRuntimeError in childr)rangerrr$r%rRuntimeErrorrr(r)r'r+)levelreleasein_childir2rr0s     rfork_with_import_lockzDForkTest.test_nested_import_lock_fork.<locals>.fork_with_import_lockEsGH
+"5\%((*1%'')C#&wH"7^+((*+"NN3N2#7^+((*+
*56HHQK
sAB$C&B>>CADN)r7)r0r=r9rs`  @rtest_nested_import_lock_forkz%ForkTest.test_nested_import_lock_forkAs*	321X	)E!%(	)rN)__name__
__module____qualname__r4r?rrrrs
(V)rrc,tjy)N)r
reap_childrenrCrrtearDownModulerFbsr__main__)__doc___imprr$r-r
rrunittesttest.fork_waitrtestrhas_fork_supportSkipTestrrFr@mainrCrr<module>rPst	

#
(

B
CCJ)xJ)ZzHMMOr