+
    BiHX                     n   ^ RI t ^ RIt^ RIt^ RIHt ^ RIt^ RIHtHt ]P                  ! R4      t
^ RIHt ^ RIH
tHt ^ RIHt ^RIHtHt Rt]P0                  ]P2                  ,          tR	 t ! R
 R]4      t ! R R]4      t ! R R]4      t ! R R]4      t]R8X  d   ]P@                  ! 4        R# R# )    N)dedent)import_helperPy_DEBUG_interpqueues)interpreters)_queues_crossinterp)_run_outputTestBasei  c                  <    \        \        P                  4       4      # N)lenr   list_all     9/usr/lib/python3.14/test/test_interpreters/test_queues.pyget_num_queuesr      s    w!""r   c                   &   a  ] tR t^t o R tRtV tR# )r   c                    \         P                  4        F  w  p p \         P                  V4       K  	  R #   \         d     K1  i ; ir   )r   r   destroy	Exception)selfqid_s   &  r   tearDownTestBase.tearDown   s@     ))+ICA$ ,  s   8AAr   N)__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell____classdict__s   @r   r   r      s      r   r   c                   8   a  ] tR t^ t o R tR tR tR tRtV t	R# )LowLevelTestsc                :    \         P                  ! \        4       R # r   )	importlibreloadqueuesr   s   &r   test_highlevel_reloaded%LowLevelTests.test_highlevel_reloaded)   s     r   c                   \         P                  ^\        R4      p\         P                  V4       V P	                  \        4       ^ 4       V P                  \        P                  4      ;_uu_ 4        \         P                  V4       RRR4       V P                  \        P                  4      ;_uu_ 4        \         P                  V4       RRR4       R#   + '       g   i     LW; i  + '       g   i     R# ; i)   N)
r   createREPLACEr   assertEqualr   assertRaisesr*   QueueNotFoundErrorgetr   r   s   & r   test_create_destroy!LowLevelTests.test_create_destroy-   s    nnQ,)1-v8899KK :v8899OOC  :9 :9999s   2C7C*C'	*C;	c           
         V P                  R \        R\        P                   R\         R24      4      w  rV P                  VR4       \        '       d   V P                  VR4       R# V P                  VR4       R# )z-cz
                import z. as _queues
                _queues.create(2, z, -1)
                 N)assert_python_okr   r   r   r2   r3   r   assertNotEqual)r   stdoutstderrs   &  r   test_not_destroyed LowLevelTests.test_not_destroyed6   s{    .. (() *##*) , 
 	$8+VR(r   c           	     |   V P                  R 4      ;_uu_ 4        \        P                  ^\        R4      p\        P	                  V4       \        P                  V4       V P                  \        4       ^ 4       RRR4       V P                  R4      ;_uu_ 4        \        P                  ^\        R4      p\        P	                  V4       \        P	                  V4       \        P                  V4       \        P                  V4       V P                  \        4       ^ 4       RRR4       V P                  R4      ;_uu_ 4        \        P                  ^\        R4      p\        P	                  V4       \        P	                  V4       \        P                  V4       \        P                  V4       V P                  \        4       ^ 4       RRR4       V P                  R4      ;_uu_ 4        \        P                  ^\        R4      pV P                  \        P                  4      ;_uu_ 4        \        P                  V4       RRR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     ELT; i  + '       g   i     L; i  + '       g   i     LU; i  + '       g   i     R# ; i)typicalNzbind too muchnestedzrelease without bindingr0   )subTestr   r1   r2   bindreleaser3   r   r   r4   r*   
QueueErrorr7   s   & r   test_bind_releaseLowLevelTests.test_bind_releaseE   s   \\)$$..GR0CLLOOC ^-q1	 % \\/**..GR0CLLLLOOC OOC ^-q1 + \\(##..GR0CLLLLOOC OOC ^-q1 $ \\344..GR0C""6#4#455$ 6 54- %$$ +** $# 65 544sK   A IB
I0B
J1AJ*4J	
J*I-	0J	J	J'"J**J;	r   N)
r   r   r   r    r,   r8   r@   rI   r!   r"   r#   s   @r   r&   r&       s     !!)% %r   r&   c                   V   a  ] tR t^bt o R tR tR tR tR tR t	R t
R tR	 tR
tV tR# )
QueueTestsc           	        V P                  R 4      ;_uu_ 4        \        P                  ! 4       pV P                  VP                  ^ 4       RRR4       V P                  R4      ;_uu_ 4        \        P                  ! ^4      pV P                  VP                  ^4       RRR4       V P                  R4      ;_uu_ 4        \        P                  ! ^d4      pV P                  VP                  ^d4       RRR4       V P                  R4      ;_uu_ 4        \        P                  ! ^ 4      pV P                  VP                  ^ 4       RRR4       V P                  R4      ;_uu_ 4        \        P                  ! R4      pV P                  VP                  R4       RRR4       V P                  R4      ;_uu_ 4        V P                  \        4      ;_uu_ 4        \        P                  ! R4       RRR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELA; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L}; i  + '       g   i     R# ; i)	vanillaNzsmall maxsizezbig maxsizez
no maxsizeznegative maxsizezbad maxsize1)rE   r*   r1   r3   maxsizer4   	TypeErrorr   queues   & r   test_createQueueTests.test_created   s   \\)$$MMOEU]]A. % \\/**MM!$EU]]A. + \\-((MM#&EU]]C0 ) \\,''MM!$EU]]A. ( \\,--MM#&EU]]C0 . \\-((""9--c" . )() %$$ +** )(( ('' .-
 .- )((s_   2H-3H3H,3I )3I=I:I'	2I:H	H)	,H=	 I	I$	'I72I::J	c                   \         P                  ! 4       p\        P                  ! 4       pVP                  \	        R VP
                   R24      4       V P                  R4      ;_uu_ 4        \         P                  ! 4       pVP                  V4       VP                  4       pV P                  WC4       RRR4       V P                  R4      ;_uu_ 4        \         P                  ! 4       pVP                  V4       \        V\	        R4      4      p\        V4      pV P                  WuP
                  4       RRR4       V P                  R4      ;_uu_ 4        \        V\	        R4      4      p\        V4      pVP                  4       pV P                  VP
                  V4       RRR4       R#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     R# ; i)ze
            from concurrent.interpreters import _queues as queues
            queue1 = queues.Queue(z)
            zsame interpreterNzfrom current interpreterzX
                queue4 = queue1.get()
                print(queue4.id)
                zfrom subinterpreterz~
                queue5 = queues.create()
                queue1.put(queue5)
                print(queue5.id)
                )r*   r1   r   execr   idrE   putr6   assertIsr
   intr3   )	r   queue1interpqueue2queue3queue4outr   queue5s	   &        r   test_shareableQueueTests.test_shareable}   sk   $$&F  ##)99+ .  	
 \\,--]]_FJJvZZ\FMM&)	 . \\455]]_FJJvff . ' C c(CS)), 6 \\/00ff . ' C
 c(CZZ\FVYY, 10! .-- 65 100s'   ,AF/A"GAG/G 	G	G'	c                p    \         P                  ! 4       pV P                  VP                  \        4       R # r   )r*   r1   assertIsInstancerY   r\   rS   s   & r   test_id_typeQueueTests.test_id_type   s!    ehh,r   c                    V P                  \        P                  4      ;_uu_ 4        \        P                  ! R 4       RRR4       R#   + '       g   i     R# ; i@B N)r4   r*   r5   Queuer+   s   &r   test_custom_idQueueTests.test_custom_id   s4    v8899LL# :999s   A		A	c                    \         P                  ! 4       pV P                  \        4      ;_uu_ 4        R Vn        RRR4       R#   + '       g   i     R# ; irk   )r*   r1   r4   AttributeErrorrY   rS   s   & r   test_id_readonlyQueueTests.test_id_readonly   s4    ~.. EH /...s   AA	c                    \         P                  ! ^
4      pV P                  \        4      ;_uu_ 4        RVn        RRR4       R#   + '       g   i     R# ; i)
   rl   N)r*   r1   r4   rq   rQ   rS   s   & r   test_maxsize_readonly QueueTests.test_maxsize_readonly   s7    b!~..%EM /...s   AA	c                    \         P                  ! 4       p\        VP                  4      p\        V4      pV P	                  W24       R # r   )r*   r1   hashrY   r3   )r   rT   expectedactuals   &   r   test_hashableQueueTests.test_hashable   s1    >e*r   c                    \         P                  ! 4       p\         P                  ! 4       pV P                  W4       V P                  W4       R # r   )r*   r1   r3   r=   )r   r]   r_   s   &  r   test_equalityQueueTests.test_equality   s4    (F+r   c                f   \         P                  ! 4       p\        \        P                  ^,           4       Fc  pV P                  VR7      ;_uu_ 4        \        P                  ! W4      p\        P                  ! V4      pV P                  WA4       RRR4       Ke  	  R#   + '       g   i     Kz  ; i)   )protocolN)	r*   r1   rangepickleHIGHEST_PROTOCOLrE   dumpsloadsr3   )r   rT   r   data	unpickleds   &    r   test_pickleQueueTests.test_pickle   st    f559:Hx00||E4"LL.	  2 10 ;000s   >BB0r   N)r   r   r   r    rU   rd   rh   rn   rr   rv   r|   r   r   r!   r"   r#   s   @r   rL   rL   b   s8     #2!-F-$!
&
+,3 3r   rL   c                      a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tRtV tR# )TestQueueOpsc                >   \         P                  ! 4       pVP                  4       pVP                  R 4       VP                  4       pVP	                  4        VP                  4       pV P                  VR4       V P                  VR4       V P                  VR4       R # )NTF)r*   r1   emptyrZ   r6   r[   )r   rT   beforeduringafters   &    r   
test_emptyTestQueueOps.test_empty   sl    		$		fd#fe$eT"r   c           
     f	   R EF?  pV P                  RV 24      ;_uu_ 4        TpR.V^,          ^,           ,          pRW1&   RW1^,           &   \        P                  ! V4      p. pVP                  4       .p\	        V4       F3  pVP                  VP                  4       4       VP                  R4       K5  	  VP                  VP                  4       4       V P                  \        P                  4      ;_uu_ 4        VP                  R4       RRR4       VP                  VP                  4       4       \	        V4       F2  pVP                  VP                  4       4       VP                  4        K4  	  VP                  VP                  4       4       V P                  \        P                  4      ;_uu_ 4        VP                  4        RRR4       VP                  VP                  4       4       VP                  VP                  4       4       V P                  WS4       V P                  V. RO4       RRR4       EKB  	  R EF  pT P                  V'       d   RV^ ,           2MR4      ;_uu_ 4        ^pR.V^,          ^,           ,          p\        P                  ! V!  p. pVP                  4       .p\	        V4       F3  pVP                  VP                  4       4       VP                  R4       K5  	  VP                  VP                  4       4       VP                  VP                  4       4       \	        V4       F2  pVP                  VP                  4       4       VP                  4        K4  	  VP                  VP                  4       4       V P                  \        P                  4      ;_uu_ 4        VP                  4        RRR4       VP                  VP                  4       4       VP                  VP                  4       4       V P                  WS4       V P                  V. RO4       RRR4       EK  	  R#   + '       g   i     ELG; i  + '       g   i     EL; i  + '       g   i     EK  ; i  + '       g   i     L; i  + '       g   i     EKg  ; i)	r   zmaxsize=FTNz	<default>)r         )TFT)r   )r   )r0   )rP   )rE   r*   r1   r   r   appendfull
put_nowaitr4   	QueueFull
get_nowait
QueueEmptyr3   )	r   rQ   
num_to_addrz   rT   r{   r   r   argss	   &        r   	test_fullTestQueueOps.test_full   sM   !G	233$
!7j1nq&89$(!(,1%g.z*AMM%**,/$$T* + ejjl+&&v'7'788$$T* 9U[[]+z*AMM%**,/$$& + ejjl+&&v'8'899$$& :ejjl+U[[]+  2  (;<9 43 "@ .Dda	2LL
!7j1nq&89t,z*AMM%**,/$$T* + ejjl+U[[]+z*AMM%**,/$$& + ejjl+&&v'8'899$$& :ejjl+U[[]+  2  (;<1 ML .# 988 :99- 433d :9% MLLsd   CQ6>QB.Q6>Q"A+Q6:E	RRA+RQ	Q6"Q3-	Q66RRRR0c                   . ROp. p\         P                  ! 4       p\        ^4       F3  pVP                  VP	                  4       4       VP                  R4       K5  	  VP                  VP	                  4       4       VP                  4        VP                  VP	                  4       4       VP                  R4       VP                  VP	                  4       4       \        ^4       F2  pVP                  4        VP                  VP	                  4       4       K4  	  VP                  R4       VP                  VP	                  4       4       VP                  4        VP                  VP	                  4       4       V P                  W!4       R# )r   N)r   r   r/   r   r/   r   r/   r   r   r   r   )r*   r1   r   r   qsizerZ   r6   r3   )r   rz   r{   rT   r   s   &    r   
test_qsizeTestQueueOps.test_qsize  s    4qAMM%++-(IIdO  	ekkm$		ekkm$		$ekkm$qAIIKMM%++-(  			$ekkm$		ekkm$*r   c                   \        \        ^4      4      p\        P                  ! 4       p\        ^4       F  pVP	                  V4       K  	  \        ^4       Uu. uF  qBP                  4       NK  	  ppV P                  WQ4       R# u upi )   N)listr   r*   r1   rZ   r6   r3   )r   rz   rT   ir   r{   s   &     r   test_put_get_mainTestQueueOps.test_put_get_main'  sb    b	?rAIIaL ',Ry1y!))+y1* 2s   Bc                   \         P                  ! ^4      pVP                  R4       VP                  R4       V P                  \         P                  4      ;_uu_ 4        VP                  RRR7       RRR4       V P                  \         P                  4      ;_uu_ 4        VP                  R\
        R4       RRR4       VP                  4        VP                  R4       R#   + '       g   i     Lz; i  + '       g   i     LF; i)r/   N皙?timeout)r*   r1   rZ   r4   r   HUGE_TIMEOUTr6   rS   s   & r   test_put_timeoutTestQueueOps.test_put_timeout0  s    a 		$		$v//00IIdCI( 1v//00IIdL#. 1				$ 1000s    C&#C9&C6	9D		c                   \         P                  ! ^4      pVP                  R4       VP                  R4       V P                  \         P                  4      ;_uu_ 4        VP                  R4       RRR4       V P                  \         P                  4      ;_uu_ 4        VP                  RR4       RRR4       V P                  \         P                  4      ;_uu_ 4        VP                  RR\        R7       RRR4       VP                  4        VP                  R4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     LY; i)r/   NFr   )r*   r1   r   r4   r   rZ   r   r6   rS   s   & r   test_put_nowaitTestQueueOps.test_put_nowait;  s    a v//00T" 1v//00IIdE" 1v//00IIdE<I8 1		 100000s$    D'!D:#E'D7	:E
	E	c                   R R^
RRR. ROR^R^/3 F  pV P                  \        V4      4      ;_uu_ 4        \        P                  ! 4       pVP	                  V4       VP                  4       pV P                  W14       VP	                  V4       VP                  4       pV P                  W14       R R R 4       K  	  R #   + '       g   i     K  ; i)NTspam   spamab)r   r   r   r/   r   )rE   reprr*   r1   rZ   r6   r3   r   )r   objrT   obj2s   &   r   test_put_full_fallback#TestQueueOps.test_put_full_fallbackH  s    "c2

C d3i((		#yy{  +		#'')  + )(

 )((s   A:B>>Cc                   \         P                  ! 4       pV P                  \         P                  4      ;_uu_ 4        VP	                  R R7       RRR4       V P                  \         P                  4      ;_uu_ 4        VP	                  \
        R 4       RRR4       R#   + '       g   i     LX; i  + '       g   i     R# ; i)r   r   N)r*   r1   r4   r   r6   r   rS   s   & r   test_get_timeoutTestQueueOps.test_get_timeout_  sw    v0011IIcI" 2v0011IIlC( 21 21111s   B ?B3 B0	3C	c                4   \         P                  ! 4       pV P                  \         P                  4      ;_uu_ 4        VP	                  4        R R R 4       V P                  \         P                  4      ;_uu_ 4        VP                  R4       R R R 4       V P                  \         P                  4      ;_uu_ 4        VP                  R\        R7       R R R 4       R #   + '       g   i     L; i  + '       g   i     Ll; i  + '       g   i     R # ; i)NFr   )r*   r1   r4   r   r   r6   r   rS   s   & r   test_get_nowaitTestQueueOps.test_get_nowaitf  s    v0011 2v0011IIe 2v0011IIe\I2 21	 2111111s#   C =C3>D C0	3D	D	c                   \        \        ^4      4      p\        P                  ! 4       pR F  pV P	                  V R24      ;_uu_ 4        \        W#4      p\        ^4       F  pVP                  V4       K  	  \        ^4       Uu. uF	  qd! 4       NK  	  ppV P                  Wq4       . ROpVP                  V4       V! 4       p	V P                  W4       V P                  W4       RRR4       K  	  R# u upi   + '       g   i     K  ; i)r   ()Nr6   r   r   )	r   r   r*   r1   rE   getattrrZ   r3   assertIsNot)
r   rz   rT   methnamer6   r   r   r{   r   r   s
   &         r   test_put_get_full_fallback'TestQueueOps.test_put_get_full_fallbacko  s    b	?-H
"o..e.rAIIaL #).r3A#%3  2		#u  +  + /. . 4 /..s   <C:C5
AC:5C::Dc           
     $   \         P                  ! 4       pVP                  \        R 4      4       R FF  pV P	                  V R24      ;_uu_ 4        VP                  \        RV R24      4       RRR4       KH  	  R#   + '       g   i     K]  ; i)zs
            from concurrent.interpreters import _queues as queues
            queue = queues.create()
            r   zh
                    orig = b'spam'
                    queue.put(orig)
                    obj = queue.z()
                    assert obj == orig, 'expected: obj == orig'
                    assert obj is not orig, 'expected: obj is not orig'
                    Nr   )r   r1   rX   r   rE   )r   r^   r   s   &  r   test_put_get_same_interpreter*TestQueueOps.test_put_get_same_interpreter  s    $$&F   	 .H
"o..F (! "*
 +$   /. ....s   A>>Bc                z   \         P                  ! 4       p\        P                  ! 4       p\        P                  ! 4       pV P                  \	        \        P
                  ! 4       4      ^4       R
 EF1  pV P                  V R24      ;_uu_ 4        RpVP                  V4       \        V\        RVP                   RVP                   RV R\        V4       R2	4      4      pV P                  \	        \        P
                  ! 4       4      ^4       V P                  VP                  4       ^ 4       V P                  VP                  4       ^4       \        W44      pV! 4       pV P                  VR4       V P                  \        V4      \        V4      4       R	R	R	4       EK4  	  R	#   + '       g   i     EKJ  ; i)r/   r   r   z}
                        from concurrent.interpreters import _queues as queues
                        queue1 = queues.Queue(z0)
                        queue2 = queues.Queue(z{)
                        assert queue1.qsize() == 1, 'expected: queue1.qsize() == 1'
                        obj = queue1.a  ()
                        assert queue1.qsize() == 0, 'expected: queue1.qsize() == 0'
                        assert obj == b'spam', 'expected: obj == obj1'
                        # When going to another interpreter we get a copy.
                        assert id(obj) != aV  , 'expected: obj is not obj1'
                        obj2 = b'eggs'
                        print(id(obj2))
                        assert queue2.qsize() == 0, 'expected: queue2.qsize() == 0'
                        queue2.put(obj2)
                        assert queue2.qsize() == 1, 'expected: queue2.qsize() == 1'
                        s   eggsNr   )r   r1   r*   r3   r   r   rE   rZ   r
   r   rY   r   r   r=   r\   )	r   r^   r]   r_   r   obj1rb   r6   r   s	   &        r   #test_put_get_different_interpreters0TestQueueOps.test_put_get_different_interpreters  s\   $$&V__./3-H
"o..

4 !  //5yyk ://5yyk :&&.Z 0+ ,.d8* 5 $   V__%6!7;  3  3f/u  w/##BtHc#h7; /. ....s   D	F((F:c           	     ~  a  RV 3R llpS P                  R4      ;_uu_ 4        \        P                  ! 4       pV! V4      p?VP                  4       pS P	                  V\        P
                  4       S P                  VP                  4       ^ 4       S P                  \        P                  4      ;_uu_ 4        VP                  4        R R R 4       R R R 4       S P                  R4      ;_uu_ 4        \        P                  ! 4       pV! V\        P
                  4      p?VP                  4       pS P	                  V\        P
                  4       S P                  VP                  4       ^ 4       S P                  \        P                  4      ;_uu_ 4        VP                  4        R R R 4       R R R 4       S P                  R4      ;_uu_ 4        \        P                  ! 4       pV! V\        P                  4      p?S P                  VP                  4       ^4       S P                  \        P                  4      ;_uu_ 4        VP                  4        R R R 4       S P                  VP                  4       ^ 4       S P                  \        P                  4      ;_uu_ 4        VP                  4        R R R 4       R R R 4       S P                  R4      ;_uu_ 4        \        P                  ! 4       pV! V\        P                  4      p?S P                  VP                  4       ^ 4       S P                  \        P                  4      ;_uu_ 4        VP                  4        R R R 4       VP                  R\        P                  R7       S P                  VP                  4       ^4       V! V\        P                  ^4      pS P                  VP                  4       ^4       VP                  ^*\        P                  R7       S P                  VP                  4       ^4       ?S P                  VP                  4       ^4       VP                  4       pVP                  4       pS P                  VR4       S P                  V^*4       S P                  VP                  4       ^ 4       S P                  \        P                  4      ;_uu_ 4        VP                  4        R R R 4       R R R 4       R #   + '       g   i     EL7; i  + '       g   i     ELC; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL&; i  + '       g   i     L; i  + '       g   i     R # ; i)	Nc                 :  < V'       g   R pMYV\         P                  J d   RpMBV\         P                  J d   RpM+V\         P                  J d   RpM\	        \        V4      4      h\        P                  ! 4       p\        V\        RV P                   RV RV R24      4       SP                  V P                  4       V^,           4       V^ 8X  dJ   V P                  4       pSP                  VR4       SP                  V P                  4       V^,           4       V# )	r;   z, unbounditems=queues.UNBOUNDz#, unbounditems=queues.UNBOUND_ERRORz$, unbounditems=queues.UNBOUND_REMOVEzl
                from concurrent.interpreters import _queues as queues
                queue = queues.Queue(z^)
                obj1 = b'spam'
                obj2 = b'eggs'
                queue.put(obj1z )
                queue.put(obj2z)
                r   )r*   UNBOUNDUNBOUND_ERRORUNBOUND_REMOVENotImplementedErrorr   r   r1   r
   r   rY   r3   r   r6   )rT   unboundpresize	extraargsr^   r   r   s   &&&   r   commonATestQueueOps.test_put_cleared_with_subinterpreter.<locals>.common  s    	FNN*;	F000A	F111B	)$w-88!((*F ,&&+hhZ 0  )k *(k *( !  U[[]GaK8!|yy{  w/  !<Mr   defaultr   r   r   s   ham)unbounditems)Nr   )rE   r*   r1   r6   r[   r   r3   r   r4   r   r   r   ItemInterpreterDestroyedr   rZ   )r   r   rT   r^   r   r   s   f     r   $test_put_cleared_with_subinterpreter1TestQueueOps.test_put_cleared_with_subinterpreter  s   	< \\)$$MMOEE]F99;DMM$/U[[]A.""6#4#455  " 6 % \\)$$MMOEE6>>2F99;DMM$/U[[]A.""6#4#455  " 6 % \\/**MMOEE6#7#78FU[[]A.""6#B#BCC		 D U[[]A.""6#4#455  " 6 + \\*++MMOEE6#8#89FU[[]A.""6#4#455  " 6 IIf6+@+@IAU[[]A.E6#8#8!<FU[[]A.IIbv'<'<I=U[[]A.U[[]A.99;D99;DT6*T2&U[[]A.""6#4#455  " 6- ,+5 655 %$$" 655 %$$  DCC 655 +**& 655  65- ,++s   BT9S8	
T3B%T4T 	)T4A5U0U	AU0'U	8U0!A5V+V	'E.V+V	&V+8T		TT	 T1+	T44U	U	U0U-'	U00V	V	V+V(#V++V<	c                   \         P                  ! 4       p\        P                  ! 4       p\        V\	        R VP
                   R24      4       V P                  VP                  4       ^4       ?V P                  VP                  4       ^4       VP                  4       pV P                  V\         P                  4       V P                  VP                  4       ^4       V P                  \         P                  4      ;_uu_ 4        VP                  4        RRR4       V P                  VP                  4       ^4       VP                  4       pV P                  V\         P                  4       V P                  VP                  4       ^4       VP                  4       pV P                  V\         P                  4       V P                  VP                  4       ^ 4       R#   + '       g   i     L; i)d
            from concurrent.interpreters import _queues as queues
            queue = queues.Queue(a  )
            queue.put(1, unbounditems=queues.UNBOUND)
            queue.put(2, unbounditems=queues.UNBOUND_ERROR)
            queue.put(3)
            queue.put(4, unbounditems=queues.UNBOUND_REMOVE)
            queue.put(5, unbounditems=queues.UNBOUND)
            N)r*   r1   r   r
   r   rY   r3   r   r6   r[   r   r4   r   )r   rT   r^   r   r   obj3s   &     r   *test_put_cleared_with_subinterpreter_mixed7TestQueueOps.test_put_cleared_with_subinterpreter_mixed  sT   $$&FF (""'(( ,$  	 	**yy{dFNN+*v>>??IIK @*yy{dFNN+*yy{dFNN+* @?s   G!!G1	c                (   \         P                  ! 4       p\        P                  ! 4       p\        P                  ! 4       pVP                  ^4       \	        V\        RVP                   R24      4       \	        V\        RVP                   R24      4       V P                  VP                  4       ^ 4       VP                  ^4       \	        V\        R4      4       \	        V\        R4      4       \	        V\        R4      4       V P                  VP                  4       ^
4       VP                  4       pV P                  V^4       V P                  VP                  4       ^	4       VP                  4       pV P                  V^4       V P                  VP                  4       ^4       ?V P                  VP                  4       ^4       VP                  4       pV P                  V\         P                  4       V P                  VP                  4       ^4       VP                  4       pV P                  V^4       V P                  VP                  4       ^4       ?V P                  VP                  4       ^4       V P                  \         P                  4      ;_uu_ 4        VP                  4        RRR4       V P                  VP                  4       ^4       VP                  4       pV P                  V\         P                  4       V P                  VP                  4       ^4       VP                  4       p	V P                  V	\         P                  4       V P                  VP                  4       ^ 4       R#   + '       g   i     L; i)r   r   z)
            obj1 = queue.get()
            queue.put(2, unbounditems=queues.UNBOUND)
            queue.put(obj1, unbounditems=queues.UNBOUND_REMOVE)
            zL)
            obj2 = queue.get()
            obj1 = queue.get()
            z
            queue.put(4, unbounditems=queues.UNBOUND)
            # interp closed here
            queue.put(5, unbounditems=queues.UNBOUND_REMOVE)
            queue.put(6, unbounditems=queues.UNBOUND)
            a  
            queue.put(7, unbounditems=queues.UNBOUND_ERROR)
            # interp closed here
            queue.put(obj1, unbounditems=queues.UNBOUND_ERROR)
            queue.put(obj2, unbounditems=queues.UNBOUND_REMOVE)
            queue.put(8, unbounditems=queues.UNBOUND)
            z
            queue.put(9, unbounditems=queues.UNBOUND_REMOVE)
            queue.put(10, unbounditems=queues.UNBOUND)
            N)r*   r1   r   rZ   r
   r   rY   r3   r   r6   r[   r   r4   r   )
r   rT   interp1interp2r   obj4obj6obj7obj8obj10s
   &         r   -test_put_cleared_with_subinterpreter_multiple:TestQueueOps.test_put_cleared_with_subinterpreter_multiple1  s   %%'%%'		!GV )""'(( ,%  	 	GV )""'(( ,%  	 	*		!GV %  	 	GV %  	 	GV %  	 	+yy{q!*yy{q!** yy{dFNN+*yy{q!** v>>??IIK @* yy{dFNN+* 		eV^^,* @?s   &NN	c                d  aa \         P                  ! 4       o\         P                  ! 4       oVV3R  lp\        P                  ! VR7      pVP	                  4        RpSP                  V4       SP                  4       pVP                  4        V P                  WC4       V P                  WC4       R# )c                     <   SP                  RR7      p  SP                  T 4       R#   \        P                   d     K@  i ; i)Tr   r   N)r6   r*   r   rZ   )r   r]   r_   s    r   f6TestQueueOps.test_put_get_different_threads.<locals>.f  sE     **S*1C JJsO (( s   * AA)targetr   N)
r*   r1   	threadingThreadstartrZ   r6   joinr3   r   )r   r   torigr   r]   r_   s   &    @@r   test_put_get_different_threads+TestQueueOps.test_put_get_different_threads  sz    	 A&		

4jjl	##r   r   N)r   r   r   r    r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r!   r"   r#   s   @r   r   r      sa     
#:=x+,+	,.)3,$ $8LW#r+BO+b$ $r   r   __main__)!r(   r   r   textwrapr   unittesttest.supportr   r   import_moduler   
concurrentr   concurrent.interpretersr*   r	   test._crossinterp_definitions_crossinterp_definitionsdefsutilsr
   r   	_TestBaser   _UNBOUND_CONSTANT_TO_FLAGr   r2   r   r&   rL   r   r   mainr   r   r   <module>r     s         0

%
%o
6 # C , 5

0
01E1E
F#y ?%H ?%Db3 b3JP$8 P$f zMMO r   