403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/__pycache__/test__interpchannels.cpython-315.opt-1.pyc
R
>lqj�c��]QHGs]PHs]PHs]QHGs]PHs]PHs]PH s]QH$G
s
\
OQ2s]QH4Gs]QH<GsGsGs\O&\O(*sQsQP
-Q	ksQ
s-1QksQQ
\Q
Q22s\O6Q2sQQ\QQ22sQQ\QQ22sQP	-QksQs Qs!QQ\OD2s#QQ\#2s$QQ\#2s%Q Q!\#2s&Q"Q#\Q#Q$22s'\OPQ%2Q&Q'\#22s)\*Q(6Xc\OV2P!P!))�)�
namedtuple)�dedent)�
import_helper�_interpchannels)�_crossinterp)�
_interpreters�_run_output�clean_up_interpretersc��[OU2vqU![Oc[OQ2JIh9h)T皙�����?)�	_channels�recv�ChannelEmptyError�time�sleep)�cid�obj�	unboundops&  �.C:\Python315\\Lib\test\test__interpchannels.py�	recv_waitrsC��
�	�&�^�^�C�0�N�C�
�J��	�*�*�	��J�J�s�O�	�s��A�A�A�unboundc�>�[OU,UN3vq4U!�N)rr
)rr�argsrrs&$*  r�recv_nowaitr*s���^�^�C�/�$�/�N�C��J�c� �[VU2P!r)�_run_interp)�id�source�shareds&&,r�
run_interpr!:s����F�#rc���[U2o[O2uqEV@6Xc0[O2uqeVd6wc[g[V2P![OVU2P!r)rr�get_main�get_current�RuntimeError�exec�
run_string)rrr �_mainns�main�_�curs&&&&   rrr>sS��
�F�^�F��%�%�'�H�D��z��+�+�-����;����V��� � ��V�4rc�H``�\sQs]Ksn\Q2sQU1QkksQsUsU9s	!)�Interpreterc�r�[V2%cU![U[2%c	UU2![gr)�
isinstance�str�NotImplementedError)�cls�raws&&r�from_raw�Interpreter.from_rawMs.���c����J�
��S�
!�
!��s�8�O�%�%rc�V:�[O2uq4V#6Xc0U%fQoL!UQ6wc[QOU22gSoLKUdU%fQoL<UQ6Xc[Q2gL)U%cUQ6XcQoSoL[O2o[
RU_VU2oU!)r)z)name mismatch (expected "main", got "{}")�interpz!name mismatch (unexpected "main"))rr#�
ValueError�format�create�super�__new__)r2�namerr)r*�self�	__class__s&&&   �rr<�Interpreter.__new__Vs���� �)�)�+���
�:������� �?�F�F�t�L�N�N��B�
�^������� �!D�E�E� ������D��B��%�%�'�B��w��s�"�-���r��NN)
�__name__�
__module__�__qualname__�__firstlineno__�classmethodr4r<�__static_attributes__�__classdictcell__�
__classcell__�r?�
__classdict__s@@rr-r-Ks!�����&��&��rr-zname idc#�T �Pw�P![OcP!h9h3hr)r�ChannelClosedErrorrArr�expect_channel_closedrOps$���+�
���'�'�
��
�s �(��(�%�%�(�%�(c�J``�\sQs]zsnQU1QkksQsQsQsQsUs	U9s
!)�
ChannelActionc�R:�U%fQoU%fQo[RU_VV#2oU!)�bothr)�r;r<)r2�action�endr7r>r?s&&&& �rr<�ChannelAction.__new__|s(�����C���F��w��s�C�8���rc�^�UOQ6Xc(UOQ7c[UO2gLMUOQ7c(UOQ7c[UO2gL[UO2gUOQ7c[UO2gP!)�use��same�opposite�sendr
��close�force-close)rSr[r\r]r
)r)r[�other�extra)rUrVr8r7)r>r�kwargss&*,r�__init__�ChannelAction.__init__�s����;�;�%���x�x�C�C� ����*�*�D�
�[�[�4�
4��x�x�K�K� ����*�*�L��T�[�[�)�)��;�;�@�@��T�[�[�)�)�Arc�z�UOQ6XcU!UOQ6XcUQ6XcQ!Q!UO!rZ�rV�r>rVs&&r�resolve_end�ChannelAction.resolve_end�s9���8�8�v���J�
�X�X��
#� �F�]�6�6��6��8�8�Orc�,�UOQ6XcU!UOQ6Xc
Ue[gU!UOQ6Xc
Ue[gU!UOQ6Xc5UOQ6XcU!U%cUOQ6XcU![gP!)r[rarbr))r7r%r=)r>r7rarbs&&&&r�resolve_interp�ChannelAction.resolve_interp�s����;�;�&� ��M�
�[�[�G�
#��}�"�"��L�
�[�[�G�
#��}�"�"��L�
�[�[�F�
"��{�{�f�$��
��5�:�:��/���"�"�
#rrArB)rCrDrErFr<rdrirlrHrIrJrKs@@rrQrQzs�����
*��#�#rrQzaction end interpc�Z``�\sQs]�snQQP
-U1QkkksQsQsQP	-QksQsUs	U9s
!)	�ChannelState�closedc�*:�[RU_VU2oU!rrT)r2�pendingrpr>r?s&&$ �rr<�ChannelState.__new__�s����w��s�V�4���rc�`�[U2UO]*UOQ5!���rp��typerrrp�r>s&r�incr�ChannelState.incr�� ���D�z�$�,�,��*�4�;�;�?�?rc�`�[U2UO]*
UOQ5!rurxrzs&r�decr�ChannelState.decr�r}r�forcec��UO%cU%cUO]6XcU![U2U%c	]P	Q5!UOP	Q5!)rrw)rprrry)r>r�s&$rr_�ChannelState.close�s?���;�;�;��D�L�L�A�-����D�z�u�!�t�D�D�$�,�,�t�D�DrrA�r)rCrDrErFr<r{rr_rHrIrJrKs@@rroro�s6�����%���@�@�E�T�E�Errozpending closed�
hideclosedc�&�UO%c'UQ6XcUQ6XcUO%cP
oLP	oLP
o[VV#2oU%cQgU![Oc&S%f
S%fgSO2oS!h9h)rYr
.)rprr�_run_actionrrNr_)rrUrV�stater��
expectfail�results&&&&$  r�
run_actionr��s����|�|�|��U�?�s�f�}������J��J��
���S�#�5����I���M���'�'���*��������M��s#�A�B�*B�3B�;B�Bc�x�UQ6Xc�UQ6Xc)[OUQP
Q5UO2!UQ6XcOUO%f"[O	U2[Q2g[U2UO2![U2gUQ6Xc6-oUQ
7cP	VB$[OU1-U@UO2!UQ6Xc:QP	-oUQ
7cP	VB$[OU1-U@UOP	Q	5![U2g[OcSt!h9h)rYr]�spam��blockingr
zexpected ChannelEmptyErrorr_r`r��r��r
r])rr]r{rrr
�	Exceptionrrrr8r_)rrUrVr�rcs&&&& rr�r��s%��
����&�=��N�N�3��%�N�8��:�:�<��
�F�]��=�=�=�B��N�N�3�'�$�$@�A�A��C� ��z�z�|�#��S�/�!�	�7�	����"�"��F�K�����&�v�&��{�{�}��	�=�	 ��T����"�"��F�K�����&�v�&��{�{��{�&�&��� � ��1!�2�2�!� �L�!�s�D�D9�3D9�8D9c��[O2FDvoo[OU2J	P![OcJ;h9hr)r�list_all�destroy�ChannelNotFoundError)rr*s  r�clean_up_channelsr��sH���'�'�)�	��Q��	����c�"�*���-�-�	��	�s�:�A�A�Ac�(`�\sQsQsnQsQsUsP!)�TestBase�c�0�[2[2P!r)r�r	rzs&r�tearDown�TestBase.tearDowns�����rrA)rCrDrErFr�rHrI�rLs@rr�r�s���� � rr�c�^`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sQs
QsUsP!)
�ChannelIDTests�c��[O]
P	Q5oUO[U2]
2UOUOQ2P!)�
r�rS)r�_channel_id�assertEqual�intrV�r>rs& r�test_default_kwargs�"ChannelIDTests.test_default_kwargs
s?���#�#�B�d�#�3������S��2�&�������&�)rc��[O]
P	P	Q5oUOUOQ2[O]
P	P
P	Q5oUOUOQ2[O]
P	P	Q5oUOUOQ2[O]
P	P
P	Q5oUOUOQ2[O]
P	P	P	Q5oUOUOQ2P!)r��r]r�r]�r]r
r��r
r�r
)r
r]r�rS)rr�r�rVr�s& r�test_with_kwargs�ChannelIDTests.test_with_kwargss����#�#�B�T��#�>��������&�)��#�#�B�T��T�#�J��������&�)��#�#�B�T��#�>��������&�)��#�#�B�T��T�#�J��������&�)��#�#�B�T��D�#�I��������&�)rc��QQ[2o[OU2P	Q5oUO[	U2]
2P!)c�(`�\sQsQsnQsQsUsP!)�*ChannelIDTests.test_coerce_id.<locals>.Int�$c��]
!�r�rArzs&r�	__index__�4ChannelIDTests.test_coerce_id.<locals>.Int.__index__%s��rrA)rCrDrErFr�rHrIr�s@r�Intr�$s����
�
rr�r�)r0rr�r�r�)r>r�rs&  r�test_coerce_id�ChannelIDTests.test_coerce_id#s;��	�#�	��#�#�C�E��#�6������S��2�&rc���UO[[O[	22UO[[OQ2UO[[OQ2UO[[OQ2UO[
[OP2UO[[OQ2P!)g$@�10s10l)�assertRaises�	TypeErrorrr��objectr8�
OverflowErrorrzs&r�test_bad_id�ChannelIDTests.test_bad_id+s������)�Y�%:�%:�F�H�E����)�Y�%:�%:�D�A����)�Y�%:�%:�D�A����)�Y�%:�%:�E�B����*�i�&;�&;�R�@����-��)>�)>��Frc��UO[29^tt^2[O]
P
P
Q5PPP2P!)%fhP!9h)r��r]r
)r�r8rr�rzs&r�test_bad_kwargs�ChannelIDTests.test_bad_kwargs3s7��
�
�
�z�
*�
*��!�!�"�5�u�!�=�+�
*�
*�
*�s�A�A	�A	c��[O[2oUO[O29^tt^2[O[
U2]*2PPP2P!)%fhP!9h�rv)rr:�REPLACEr�r�r�r�r�s& r�test_does_not_exist�"ChannelIDTests.test_does_not_exist7sN�����w�'��
�
�
�y�=�=�
>�
>��!�!�#�c�(�Q�,�/�?�
>�
>�
>�s�&A2�2B	�;B	c�l�[O]
P	Q5oUO[U2Q2P!)r�r�r�)rr�r�r0r�s& r�test_str�ChannelIDTests.test_str<s+���#�#�B�d�#�3������S��4�(rc��[O]
P	Q5oUO[U2Q2[O]
P	P	Q5oUO[U2Q2[O]
P	P	Q5oUO[U2Q2[O]
P	P	P	Q5oUO[U2Q2P!)r�r�z
ChannelID(10)r�zChannelID(10, send=True)r�zChannelID(10, recv=True)r�)rr�r��reprr�s& r�	test_repr�ChannelIDTests.test_repr@s����#�#�B�d�#�3������c��O�4��#�#�B�T��#�>������c��$>�?��#�#�B�T��#�>������c��$>�?��#�#�B�T��D�#�I������c��O�4rc���[O[2o[O[	U22o[O[2oUOV6H2UOV6H2UOU[	U26H2UO[	U2U6H2UOU[
[	U226H2UO[
[	U22U6H2UOU[
[	U22Q*6H2UOU[[	U226H2UOU]Q*6H2UOU[
Q26H2UOUQ6H2UOV6H2UOV6g2UOV6g2UOV6g2P!)r���inf�spam)	rr:r�r�r��
assertTrue�float�assertFalser0)r>�cid1�cid2�cid3s&   r�
test_equality�ChannelIDTests.test_equalityMsi������(���$�$�S��Y�/������(�������%������%������D�	�)�*�����D�	�T�)�*������c�$�i� 0�0�1�����c�$�i�(�D�0�1������s�4�y�!1�C�!7�7�8������S��Y��/�0������D���)������u��-�.�������(������&������&������&������%rc��[O[2o[O[2o[OVP
Q5[	U2oUOV22UO
[U2[U22P!)Fr�)rr:r�r]rr��assertIsry)r>�chanr�gots&   r�test_shareable�ChannelIDTests.test_shareablecs`������(�����w�'�����t�5��1��$�������"��
�
�d�3�i��c��+rrA)rCrDrErFr�r�r�r�r�r�r�r�r�r�rHrIr�s@rr�r�s=����*�*� '�G�>�0�
)�5�&�,,�,rr�c�`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sQs
QsQ
sQsQsQs\O(Q2Q2sQsQsQsQsQsQsQsQsQsQsQs QP
-Qks!Q s"Q!s#Q"s$Q#s%Q$s&Q%s'Q&s(Q's)Q(s*Q)s+Q*s,Q+s-Q,s.Q-s/Q.s0Q/s1Q0s2Q1s3Q2s4Q3s5Q4s6Q5s7Q6s8Q7s9Q8s:Us;P!)9�ChannelTests�pc�z�[O[2oUOU[O2P!r)rr:r��assertIsInstance�	ChannelIDr�s& r�test_create_cid�ChannelTests.test_create_cidrs(�����w�'�����c�9�#6�#6�7rc�<�[O2TTt,tFDvop!MJ
	ooo[O[2o[O[2o[O[2o[O2TTt,tFDvop!MJ
	oooUO	U[U2]*2UO	U[U2]*2UO	[
U2[
U2*
VEU.2P!ttoohttoohr�)rr�r:r�r�r��set)r>rr*�before�id1�id2�id3�afters&       r�test_sequential_ids� ChannelTests.test_sequential_idsvs���'0�'9�'9�';�<�';�)�#�q�!�#�';��<����w�'�����w�'�����w�'��&/�&8�&8�&:�;�&:���a���&:��;�����c�#�h��l�+�����c�#�h��l�+�����U��c�&�k�1�C�c�?�C��=��<s�D�Dc���[O2o[O2o[O2o[O2oSTt,tFDpU]*U6wfJUMJ	oo[OUP	Q5[O2oUO	[U2[U22UO	[
U2[
U2]*
2P!ttoh)rr�)rr:r�r_r�r��len�r>r�r�r�r��info�expectedr�s&       r�test_channel_list_all_closed�)ChannelTests.test_channel_list_all_closed�s������ ����� ����� ���#�#�%��%+�>�V�T�A�w�#�~�D�D�V��>�����4��(��"�"�$������U��S��]�3�����U��S��[�1�_�5��	?s�C/�+C/c���[O2o[O2o[O2o[O2oSTt,tFDpU]*U6wfJUMJ	oo[OU2[O2oUO	[U2[U22UO	[
U2[
U2]*
2P!ttohr�)rr:r�r�r�r�r�r�s&       r�test_channel_list_all_destroyed�,ChannelTests.test_channel_list_all_destroyed�s������ ����� ����� ���#�#�%��%+�>�V�T�A�w�#�~�D�D�V��>����#���"�"�$������U��S��]�3�����U��S��[�1�_�5��	?s�C-�+C-c��[O2o[O2o[O2o[O2o[OUP	P	Q5[O2oUO	[U2[U22UO	[
U2[
U22P!)Tr�)rr:r��releaser�r�r�)r>r�r�r�r�r�s&     r�test_channel_list_all_released�+ChannelTests.test_channel_list_all_released�s������ ����� ����� ���#�#�%�����#�D�t��4��"�"�$������U��S��[�1�����U��S��[�1rc�X�[O2o[U[Q22o[	UO22o[O2o[U[Q22o[	UO22oUO
U[	U2]*2P!)zz
            import _interpchannels as _channels
            cid = _channels.create(3)
            print(cid)
            )rr:rrr��stripr�)r>r��outr�r�r�s&     r�test_ids_global�ChannelTests.test_ids_global�s����"�"�$���#�v�'� ���
�3�9�9�;����"�"�$���#�v�'� ���
�3�9�9�;�������s�4�y�1�}�-rc���[O[2o[OUP	Q5o[OUP
Q5oUO	U,2UO	U,2P!)z=Test listing interpreters for a channel with no associations.�r])rr:r��list_interpretersr�)r>r�send_interps�recv_interpss&   r�#test_channel_list_interpreters_none�0ChannelTests.test_channel_list_interpreters_none�s^�����w�'�� �2�2�3�T�2�B�� �2�2�3�U�2�C������r�*�����r�*rc�:�[O2uq[O[2o[OUQP
Q5[O
UP	Q5o[O
UP
Q5oUOVA,2UOU,2[O2o[U[QUQ022[O
UP	Q5o[O
UP
Q5oUOVA,2UOVV,2P!)z)Test basic listing channel _interpreters.r]r�r
�L
            import _interpchannels as _channels
            _channels.recv(�)
            )
rr#rr:r�r]rr�rr)r>�interp0r*rrr
�interp1s&      r�$test_channel_list_interpreters_basic�1ChannelTests.test_channel_list_interpreters_basic�s���#�,�,�.������w�'�����s�F�U��3� �2�2�3�T�2�B�� �2�2�3�U�2�C������y�1�����r�*��&�&�(���G�V�)��5�!
�%��	�
!�2�2�3�T�2�B�� �2�2�3�U�2�C������y�1�����y�1rc�v�[O2uq[O2o[O2o[O2o[O[2o[OUQP
Q5[
U[QUQ022[
U[QUQ022[
U[QUQ022[OUP	Q5o[OUP
Q5oUO[U2V.2UO[U2VE.2P!)z?Test listing interpreters for a channel with many associations.r]r��L
            import _interpchannels as _channels
            _channels.send(z&, "send", blocking=False)
            rrr
)rr#r:rr�r]rrrr�r�)	r>rr*r�interp2�interp3rrr
s	&        r�'test_channel_list_interpreters_multiple�4ChannelTests.test_channel_list_interpreters_multiple�s-��#�,�,�.����&�&�(���&�&�(���&�&�(�����w�'�����s�F�U��3��G�V�)��5�!
�%��	�	�G�V�)��5�!
�%��	�	�G�V�)��5�!
�%��	�!�2�2�3�T�2�B�� �2�2�3�U�2�C������\�*�W�,>�?�����\�*�W�,>�?rc�f�[O2uq[O2o[O[2o[OUQP
Q5[
U[QUQ022[OUP	Q5o[OUP
Q5oUOVQ,2UOVc,2[OU2[OUP	Q5o[OUP
Q5oUOVQ,2UOU,2P!)z?Test listing channel interpreters with a destroyed interpreter.r]r�rrr
)rr#r:rr�r]rrrr�r��r>rr*rrrr
s&      r�(test_channel_list_interpreters_destroyed�5ChannelTests.test_channel_list_interpreters_destroyed�s��#�,�,�.����&�&�(�����w�'�����s�F�U��3��G�V�)��5�!
�%��	�
!�2�2�3�T�2�B�� �2�2�3�U�2�C������y�1�����y�1����g�&� �2�2�3�T�2�B�� �2�2�3�U�2�C������y�1�����r�*rc�$�[O2uq[O2o[O2o[O[2o[OUQP
Q5[
U[QUQ022[OUQP
Q5[
U[QUQ022[OUP	Q5o[OUP
Q5oUO[U2]2UO[U2]2[OUP	Q5[OUP	Q5o[OUP
Q5oUO[U2]2UO[U2]2[
U[QUQ022[OUP	Q5o[OUP
Q5oUO[U2]2UOVs,2P!)z:Test listing channel interpreters with a released channel.�datar�rrr
�O
            import _interpchannels as _channels
            _channels.release()rr#r:rr�r]rrrr�r�r)r>rr*rrrrr
s&       r�'test_channel_list_interpreters_released�4ChannelTests.test_channel_list_interpreters_releaseds���$�,�,�.����&�&�(���&�&�(�����w�'�����s�F�U��3��G�V�)��5�!
�%��	�	���s�F�U��3��G�V�)��5�!
�%��	�
!�2�2�3�T�2�B�� �2�2�3�U�2�C������\�*�A�.�����\�*�A�.�	���#�D��)� �2�2�3�T�2�B�� �2�2�3�U�2�C������\�*�A�.�����\�*�A�.�	�G�V�)�"�e�$
�%��	�
!�2�2�3�T�2�B�� �2�2�3�U�2�C������\�*�A�.�����y�1rc� �[O2uq[O2o[O[2o[OUQP
Q5[O
UP	Q5o[O
UP
Q5oUO[U2]2UO[U2]2[OUP	Q5UO[O29^tt^2[O
UP	Q5PPP2UO[O29^tt^2[O
UP
Q5PPP2P!)%fhKY9h)%fhP!9h)z8Test listing channel interpreters with a closed channel.r]r�r
r�)rr#r:rr�r]rr�r�r_r�rNrs&      r�%test_channel_list_interpreters_closed�2ChannelTests.test_channel_list_interpreters_closed/s��#�,�,�.����&�&�(�����w�'�����s�F�U��3�!�2�2�3�T�2�B�� �2�2�3�U�2�C������\�*�A�.�����\�*�A�.�	����4��(�
�
�
�y�;�;�
<�
<��'�'��$�'�7�=�
�
�
�y�;�;�
<�
<��'�'��%�'�8�=�
<�=�
<��
<�
<�
<�s$�E)�E<�)E9	�2E9	�<F
	�F
	c��[O2uq[O2o[O[2o[OUQP
Q5[O
UP	Q5o[O
UP
Q5oUO[U2]2UO[U2]2[OUP	Q5UO[O29^tt^2[O
UP	Q5PPP2[O
UP
Q5oUO[U2]2[U[QUQ022P!)%fhK]9h)zCTest listing channel interpreters with a channel's send end closed.r]r�r
�M
            import _interpchannels as _channels
            _channels.close(�, force=True)
            )rr#r:rr�r]rr�r�r_r�rNrrrs&      r�.test_channel_list_interpreters_closed_send_end�;ChannelTests.test_channel_list_interpreters_closed_send_endEs:��#�,�,�.����&�&�(�����w�'�����s�F�U��3�!�2�2�3�T�2�B�� �2�2�3�U�2�C������\�*�A�.�����\�*�A�.�	����$��'�
�
�
�y�;�;�
<�
<��'�'��$�'�7�=�!�2�2�3�U�2�C������\�*�A�.�	�G�V�)� �E�"
�%��	�	�=�
<�s�E-�-E=	�6E=	c
�p�[O[2o,QNoSFD|oUOU29^tt^2[O	VP
Q5[U2oUO
VC2UO[U2[U22PPP2J~	P!)%fhJ�9h)Nr�)Nr�r��*)	rr:r��subTestr]rr�r�ry)r>r�objectsrr�s&    r�test_allowed_types�ChannelTests.test_allowed_typeshs������w�'��
���C����c�"�"����s�%��8�!�#�&��� � ��*��
�
�d�3�i��c��3�#�"��"�"�"�s�AB$	�$B5
�-B5
c�^�[O[2o[O2o[OU[UOQ52[U[Q22o[U2oUOUQ2UOUO2Q2P!)�rz�
            import _interpchannels as _channels
            print(cid.end)
            _channels.send(cid, b'spam', blocking=False)
            r�r])rr:r�r�set___main___attrs�dictr]rrrr�r�r>rr7rrs&    r�test_run_string_arg_unresolved�+ChannelTests.test_run_string_arg_unresolved{s������w�'���%�%�'���(�(���#�(�(�1C�D��&�&�*�#���
�#�������g�&��������f�-rz(disabled until high-level channels existc�`�[O[2o[OUP	Q5o[O2o[U[
Q2[UOQ52o[U2oUOUQ2UOUO2Q2P!)T)�_resolvez�
            import _interpchannels as _channels
            print(chan.id.end)
            _channels.send(chan.id, b'spam', blocking=False)
            )r�r�r])rr:r�r�rrrr7r]rr�rr8s&    r�test_run_string_arg_resolved�)ChannelTests.test_run_string_arg_resolved�s������w�'���#�#�C�$�#�7���%�%�'���&�&�*�#�

�c�h�h��!���#�������g�&��������f�-rc���[O[2oQo[OVP
Q5[	U2oUOV22UO
V22P!�r�r�)rr:r�r]rr��assertIsNot)r>r�origrs&   r�test_send_recv_main� ChannelTests.test_send_recv_main�sM�����w�'�������s�5��1��#�������#�����#rc�\�[O2o[U[Q22oP!)a%
            import _interpchannels as _channels
            cid = _channels.create(REPLACE)
            orig = b'spam'
            _channels.send(cid, orig, blocking=False)
            obj, _ = _channels.recv(cid)
            assert obj is not orig
            assert obj == orig
            )rr:rr)r>r�rs&  r�test_send_recv_same_interpreter�,ChannelTests.test_send_recv_same_interpreter�s(���"�"�$���#�v�'� ��rc���[O[2o[O2o[	U[QUQ022o[
U2oUOUQ2P!)r�', b'spam', blocking=False)
            r�)rr:r�rrrrr�)r>rr�rrs&    r�%test_send_recv_different_interpreters�2ChannelTests.test_send_recv_different_interpreters�sc�����w�'���"�"�$���#�v�+��5�!
�'� ����#�������g�&rc�`�[O[2nU1Qko[OUQ5oUO2[O
RQ2[R2oUO2UOUQ2P!)c�L:�[R2o[ORU2P!r)rrr])rrs �r�f�8ChannelTests.test_send_recv_different_threads.<locals>.f�s����C�.�C��N�N�3��$r��targetr�)
rr:r��	threading�Thread�startr]r�joinr�)r>rN�trrs&   @r� test_send_recv_different_threads�-ChannelTests.test_send_recv_different_threads�sc������w�'��	%�
���A�&��	���	����s�G�$���n��	��������g�&rc�R```�[O[2n[O2nPnUUU1Qko[O
UQ5oUO
2[ORQ2[R2oUO2UOUQ2P!)Nc
�B:�[R[QRQRQ022nP!)z�
                import time
                import _interpchannels as _channels
                while True:
                    try:
                        obj, _ = _channels.recv(z�)
                        break
                    except _channels.ChannelEmptyError:
                        time.sleep(0.1)
                assert(obj == b'spam')
                _channels.send(z, b'eggs')
                )rr)rr�rs���rrN�IChannelTests.test_send_recv_different_interpreters_and_threads.<locals>.f�s8����c�6�/1�
25��6 �
!$�u�%�+�$��CrrPr��eggs)rr:r�rrRrSrTr]rrUr�)r>rNrVrrr�rs&   @@@r�1test_send_recv_different_interpreters_and_threads�>ChannelTests.test_send_recv_different_interpreters_and_threads�sv������w�'���"�"�$����
	�
���A�&��	���	����s�G�$���n��	��������g�&rc��UO[O29^tt^2[O]
Q2PPP2P!)%fhP!9h)r�r�)r�rr�r]rzs&r�test_send_not_found� ChannelTests.test_send_not_found�s6��
�
�
�y�=�=�
>�
>��N�N�2�w�'�?�
>�
>�
>�s�A
�
A	�A	c��UO[O29^tt^2[O]
2PPP2P!)%fhP!9hr�)r�rr�r
rzs&r�test_recv_not_found� ChannelTests.test_recv_not_found�s4��
�
�
�y�=�=�
>�
>��N�N�2��?�
>�
>�
>�s�A	�	A	�A	c���[O[2oUO[O29^tt^2[OU2PPP2P!)%fhP!9hr)rr:r�r�rr
r�s& r�test_recv_empty�ChannelTests.test_recv_empty�sD�����w�'��
�
�
�y�:�:�
;�
;��N�N�3��<�
;�
;�
;�s�A"�"A3	�+A3	c�f�[2o[O[2o[	V!2o[OUPP
Q5[OU]P
Q5[OUQP
Q5[OUQP
Q5[	V!2o[	V!2o[	U2o[	V!2o[	V!2oUO
V12UO
UP2UOU]2UOUQ2UOUQ2UO
V�2P!)Nr�r�r\)r�rr:r�rr]r�r�)	r>�defaultr�obj1�obj2�obj3�obj4�obj5�obj6s	&        r�test_recv_default�ChannelTests.test_recv_default�s����(�����w�'���3�(�����s�D�5��1����s�A���.����s�G�e��4����s�G�e��4��3�(���3�(���3����3�(���3�(���
�
�d�$��
�
�d�D�!�����q�!�����w�'�����w�'��
�
�d�$rc
�6�UOQ29^tt^2[O[2o[O2o[O
U[
QUQ022[OU2UO[QUQ029^tt^2[OU2PPP2=PPP2UOQ29^tt^2[O[2o[O2o[O
U[
QUQ022[OUQP
Q5[OU2[UP	Q5[UP
Q5UO[QUQ	029^tt^2[OU2PPP2=PPP2P!)%fhCK9h)%fhCK$9h)%fhKC9h)%fhP!9h)
rpzT
                import _interpchannels as _channels
                _channels.send(z+, b'spam', blocking=False)
                zchannel z
 is closedz
still openr\r�)rz	 is empty)
r0rr:r�rr'rr��assertRaisesRegexr%r
r]r)r>r�r7r�s&   r�"test_recv_sending_interp_destroyed�/ChannelTests.test_recv_sending_interp_destroyeds���
�\�\�(�
#�
#��#�#�G�,�D�"�)�)�+�F��$�$�V�V�9 � $�v�&�5�.�
�
�!�!�&�)��'�'��*2�4�&�
�(C�E�E����t�$�E��$��\�\�,�
'�
'��#�#�G�,�D�"�)�)�+�F��$�$�V�V�9 � $�v�&�5�.�
�
�N�N�4��5�N�9��!�!�&�)���d�+���e�,��'�'��*2�4�&�	�(B�D�D����t�$�D��(�
'�	E�E�E��$�
#�
#��2D�D��(�
'�
'�sa�BG �&G	�<	G �&B=H�#G4	�9	H�G
�G
�	G � G1	�)G1	�4H
�=H
�?H�H	�H	c�\�[Q2o[O[2o[O	V!P
Q5[U2oUO
V12UOU[2UOV12QUQ$UOV12QUQ$UOV12P!)sspamspamspamr�r\:��Nsham.)
�	bytearrayrr:r��send_bufferrrAr��
memoryviewr�)r>�bufrrs&   r�test_send_buffer�ChannelTests.test_send_buffer0s�����(�����w�'�����c���7��#�������"����c�:�.�����"���C������"���C������"r�bufferc�`�U%c[OoL[Oo[O[2o[
O2oUVAP
Q5[
O2o[U2[OU2Ve*
nR]*nU1QkoU![OS2h9h)Fr�c�6:�[OR2P!r)rr)�delays�r�wait�,ChannelTests.build_send_waiter.<locals>.waitUs����J�J�u�r)	rrzr]r:r�r�	monotonicrr�)	r>rrr]r�started�stoppedr�r�s	&&$     @r�build_send_waiter�ChannelTests.build_send_waiterBs������(�(�D��>�>�D����w�'��	#��n�n�&�G���E�*��n�n�&�G�������c�"��!��
��
��	����

���c�"�s�?B3�3C
c�<```�PnQoUOU2n[O[2nUUU1Qko[O
UQ5oUO
2[ORUP	Q5UO2UORU2P!)Nr�c�.:�R2[R2nP!r�r�r�receivedr�s���rrN�2ChannelTests.test_send_blocking_waiting.<locals>.f^�����F� ��~�HrrPr�)
r�rr:r�rRrSrTr]rUr��r>rrNrVrr�r�s&   @@@r�test_send_blocking_waiting�'ChannelTests.test_send_blocking_waitingYsx��������%�%�c�*�����w�'��	&�
���A�&��	���	����s�C�$��/�	��������3�'rc�R```�Pn[Q2oUOUP	Q5n[O[2nUUU1Qko[
OUQ5oUO2[ORUP	Q5UO2UORU2P!)Nr��rc�.:�R2[R2nP!rr�r�s���rrN�9ChannelTests.test_send_buffer_blocking_waiting.<locals>.fnr�rrPr�)ryr�rr:r�rRrSrTrzrUr�r�s&   @@@r�!test_send_buffer_blocking_waiting�.ChannelTests.test_send_buffer_blocking_waitingis�������� ���%�%�c�$�%�7�����w�'��	&�
���A�&��	���	����c�3���6�	��������3�'rc�``�PnQo[O[2nUU1Qko[OUQ5oUO2[O
RUP	Q5UO2UORU2P!)Nr�c� :�[R2nP!rr��rr�s��rrN�2ChannelTests.test_send_blocking_no_wait.<locals>.f}���� ��~�HrrPr�)	rr:r�rRrSrTr]rUr��r>rrNrVrr�s&   @@r�test_send_blocking_no_wait�'ChannelTests.test_send_blocking_no_waitysh����������w�'��	&�
���A�&��	���	����s�C�$��/�	��������3�'rc�(``�Pn[Q2o[O[2nUU1Qko[O
UQ5oUO
2[ORUP	Q5UO2UORU2P!)Nr�c� :�[R2nP!rr�r�s��rrN�9ChannelTests.test_send_buffer_blocking_no_wait.<locals>.f�r�rrPr�)
ryrr:r�rRrSrTrzrUr�r�s&   @@r�!test_send_buffer_blocking_no_wait�.ChannelTests.test_send_buffer_blocking_no_wait�sp������� �����w�'��	&�
���A�&��	���	����c�3���6�	��������3�'rc�`�QoUOQ29^tt^2[O[2nUO	[
29^tt^2[O
RUP
QQ5PPP2PPP2UOQ29^tt^2[O[2nUO	[29^tt^2[O
RUP	QQ5PPP2UO	[O29^tt^2[R2o[[U22PPP2PPP2UOQ29^tt^2[O[2nU1Qko[OUQ5oUO2[O
RUP	]
Q5UO2PPP2P!)%fhCKu9h)%fhCK�9h)%fhCK#9h)%fhK�9h)%fhK�9h)%fhP!9h)r��non-blocking with timeoutr�r��timeout�timeout hit�timeout not hitc� :�[R2P!rr�r5s�rrN�)ChannelTests.test_send_timeout.<locals>.f��
����#�rrP)r0rr:r�r�r8r]�TimeoutErrorrr�printr�rRrSrTrU�r>rr�rNrVrs&    @r�test_send_timeout�ChannelTests.test_send_timeout�s�����
�\�\�5�
6�
6��"�"�7�+�C��"�"�:�.�.����s�C�%���E�/�7�
�\�\�-�
(�
(��"�"�7�+�C��"�"�<�0�0����s�C�$���D�1��"�"�9�#>�#>�?�?�&�s�+���d�8�n�%�@�	)��\�\�+�
,�
,��"�"�7�+�C�
�� � ��*�A�
�G�G�I��N�N�3��d�B�N�?�
�F�F�H�-�
,�/�.�.��7�
6�
6��1�0�0��?�?��	)�
(��-�
,�
,�s��7G/�G	�/G/�7H*�H	�)/H*� H	�8H*�!A0H=�G,
�$G,
�&	G/�/H	�8H	�H
�H
�	H*�H'
� H'
�"H*�*H:	�3H:	�=I	�I	c�*`�UOP	Um[	Q2oUOQ29^tt^2[O[2nUO[29^tt^2[ORUP
QQ5PPP2PPP2UOQ29^tt^2[O[2nUO[29^tt^2[ORUP	QQ5PPP2UO[O29^tt^2[R2o[[!U22PPP2PPP2UOQ29^tt^2[O[2nU1Qko["O$UQ	5oUO'2[ORUP	]
Q5UO)2PPP2P![c[OQ2gh9h)%fhCK�9h)%fhCK�9h)%fhCKH9h)%fhCK
9h)%fhCK9h)%fhP!9h)
T�#temporarily skipped due to refleaksr�r�rr�r�r�c� :�[R2P!rr�r5s�rrN�0ChannelTests.test_send_buffer_timeout.<locals>.f�r�rrP)�_has_run_once_timeout�AttributeError�unittest�SkipTestryr0rr:r�r�r8rzr�rrr�r�rRrSrTrUr�s&    @r�test_send_buffer_timeout�%ChannelTests.test_send_buffer_timeout�s����
	.��&�&�*.�D�&��� ��
�\�\�5�
6�
6��"�"�7�+�C��"�"�:�.�.��%�%�c�3���%�L�/�7�
�\�\�-�
(�
(��"�"�7�+�C��"�"�<�0�0��%�%�c�3��s�%�K�1��"�"�9�#>�#>�?�?�&�s�+���d�8�n�%�@�	)��\�\�+�
,�
,��"�"�7�+�C�
�� � ��*�A�
�G�G�I��!�!�#�s�T�2�!�F�
�F�F�H�-�
,��3�	K��#�#�$I�J�J�
	K��/�.�.��7�
6�
6��1�0�0��?�?�?��	)�
(�
(��-�
,�
,�s��G8�7H1�2H	�H1�57I-�,I	�/I-�5 I	�I-�>A0J�8	H�H�H.
�&H.
�(	H1�1I	�:I	�I
�I
�	I-�I*
�"I*
�$	I-�-I>	�6I>	�J	�
J	c��``�QoUOU2nUOQ29^tt^2[O[2nUU1Qko[
OUQ5oUO2UO[O29^tt^2[ORUP	Q5PPP2UO2PPP2UOQ29^tt^2[O[2nUU1Qko[
OUQ5oUO2UO[O29^tt^2[ORUP	]Q5PPP2UO2PPP2P!)%fhK�9h)%fhK�9h)%fhKP9h)%fhP!9h)r��without timeoutc�F:�R2[ORP	Q5P!�Tr��rr_�rr�s��rrN�6ChannelTests.test_send_closed_while_waiting.<locals>.f�����������4��0rrPr��with timeoutc�F:�R2[ORP	Q5P!r�r�r�s��rrNr��r�rr�)r�r0rr:r�rRrSrTr�rNr]rU�r>rrNrVrr�s&   @@r�test_send_closed_while_waiting�+ChannelTests.test_send_closed_while_waiting�sA������%�%�c�*��
�\�\�+�
,�
,��"�"�7�+�C�
1�� � ��*�A�
�G�G�I��"�"�9�#?�#?�@�@����s�C�$��7�A�
�F�F�H�-��\�\�.�
)�
)��"�"�7�+�C�
1�� � ��*�A�
�G�G�I��"�"�9�#?�#?�@�@����s�C�$���C�A�
�F�F�H�*�
)�	A�@��-�
,��$A�@��*�
)�
)�sa�A/F/�F	�8F/�1A/G� G	�:G�F,
�%F,
�'F/�/F?	�8F?	�G
�G
�
G�G&	�G&	c�^``�UOP	Um[	Q2oUOUP	Q5nUO
Q29^tt^2[O[2nUU1Qko[OUQ5oUO2UO[O29^tt^2[ORUP	Q5PPP2UO!2PPP2UO
Q29^tt^2[O[2nUU1Q	ko[OUQ5oUO2UO[O29^tt^2[ORUP	]Q
5PPP2UO!2PPP2P![c[OQ2gh9h)%fhCK9h)%fhCK9h)%fhKw9h)%fhP!9h)Tr�r�r�r�c�F:�R2[ORP	Q5P!r�r�r�s��rrN�=ChannelTests.test_send_buffer_closed_while_waiting.<locals>.f�r�rrPr�r�c�F:�R2[ORP	Q5P!r�r�r�s��rrNr�
r�rr�)�_has_run_once_closedr�r�r�ryr�r0rr:r�rRrSrTr�rNrzrUr�s&   @@r�%test_send_buffer_closed_while_waiting�2ChannelTests.test_send_buffer_closed_while_waiting�s����
	-��%�%�)-�D�%��� ���%�%�c�$�%�7��
�\�\�+�
,�
,��"�"�7�+�C�
1�� � ��*�A�
�G�G�I��"�"�9�#?�#?�@�@��%�%�c�3��%�>�A�
�F�F�H�-��\�\�.�
)�
)��"�"�7�+�C�
1�� � ��*�A�
�G�G�I��"�"�9�#?�#?�@�@��%�%�c�3��r�%�J�A�
�F�F�H�*�
)��1�	K��#�#�$I�J�J�
	K��(A�@�@��-�
,�
,��$A�@��*�
)�
)�ss�F;�A/G4�>G 	�G4�A/H�?H	�H�;	G�G� G1
�)G1
�+	G4�4H	�=H	�H
�H
�H�H,	�$H,	c��[O[2o[OUQP
Q5[	U2[OU2UO
[O29^tt^2[OUQ2PPP2UO
[O29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9h�r�r�r\�	rr:r�r]rr_r�rNr
r�s& r�test_close_single_user�#ChannelTests.test_close_single_users������w�'�����s�G�e��4��C�������
�
�
�y�;�;�
<�
<��N�N�3��(�=�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�=�
<��
<�
<�
<��$�:C �C3� C0	�)C0	�3D	�<D	c�p�[O[2o[O2o[O2o[OU[QUQ022[OU[QUQ022[O
U2[OU[QUQ022oUOUOOQ2[OU[QUQ022oUOUOOQ2P!)rrIrrz 
                _channels.send(z, b'spam')
                rN)
rr:r�rr'rr_r�ryrC)r>rr�r��excsnaps&    r�test_close_multiple_users�&ChannelTests.test_close_multiple_users!s(�����w�'���"�"�$���"�"�$��� � ��f�2��5�!
�.�'�	�	� � ��f�2��5�!
�.�'�	�	������*�*�3��< � #�u�%�8�1���	
������.�.�0D�E��*�*�3��< � #�u�%�8�1���	
������.�.�0D�Erc�\�[O[2o[OUQP
Q5[	U2[OU2UO
[O29^tt^2[OU2PPP2P!)%fhP!9hr@)rr:r�r]rr_r�rNr�s& r�test_close_multiple_times�&ChannelTests.test_close_multiple_times9sj�����w�'�����s�G�e��4��C�������
�
�
�y�;�;�
<�
<��O�O�C� �=�
<�
<�
<�s�:B�B+	�#B+	c��,QNoSFCDvq#UOV#129^tt^2[O[2o[O	UQP
Q5[U2[O
VBUQ5UO[O29^tt^2[O	UQ2PPP2UO[O29^tt^2[OU2PPP2PPP2CJ
	P!)%fhKd9h)%fhK29h)%fhCJF9h)Fr�r�r�r\))FF�TF)FT)TT)
r0rr:r�r]rr_r�rNr
)r>�testsr]r
rs&    r�test_close_empty�ChannelTests.test_close_emptyBs����� �J�D����t�l�+�+��&�&�w�/�����s�G�e��<��C� �����T��:��&�&�y�'C�'C�D�D��N�N�3��0�E��&�&�y�'C�'C�D�D��N�N�3�'�E�,�+� �E�D��D�D��,�+�+�sN�A;D=	�$D
�;/D=	�*D*
�D=	�D'� D'�"D=	�*D:�3D:�5D=	�=E
�E
c��[O[2o[OUQP
Q5[OUQP
Q5UO	[O
29^tt^2[O
U2PPP2[U2[OUQP
Q5P!)%fhK59h)r�r��hamr\�rr:r�r]r��ChannelNotEmptyErrorr_rr�s& r�%test_close_defaults_with_unused_items�2ChannelTests.test_close_defaults_with_unused_itemsUs������w�'�����s�G�e��4����s�F�U��3�
�
�
�y�=�=�
>�
>��O�O�C� �?��C�����s�G�e��4�?�
>�s�2B5�5C	�>C	c���[O[2o[OUQP
Q5[OUQP
Q5UO	[O
29^tt^2[O
UP	Q5PPP2[U2[OUQP
Q5[U2[U2[O
UP	Q5P!)%fhKb9h)r�r�r��r
r\r�r�s& r�*test_close_recv_with_unused_items_unforced�7ChannelTests.test_close_recv_with_unused_items_unforced_s������w�'�����s�G�e��4����s�F�U��3�
�
�
�y�=�=�
>�
>��O�O�C�d�O�+�?��C�����s�G�e��4��C���C������$��'�
?�
>�s�2C$�$C4	�-C4	c�X�[O[2o[OUQP
Q5[OUQP
Q5[O	UP	Q5UO[O29^tt^2[OUQ2PPP2[U2[U2UO[O29^tt^2[OU2PPP2P!)%fhKm9h)%fhP!9h)r�r�r�r
r\)	rr:r�r]r_r�rNrr
r�s& r�*test_close_send_with_unused_items_unforced�7ChannelTests.test_close_send_with_unused_items_unforcedls������w�'�����s�G�e��4����s�F�U��3�����$��'�
�
�
�y�;�;�
<�
<��N�N�3��(�=��C���C��
�
�
�y�;�;�
<�
<��N�N�3��=�
<�	=�
<��=�
<�
<�s$�	D�%D�D	�D	�D)	�!D)	c���[O[2o[OUQP
Q5[OUQP
Q5UO	[O
29^tt^2[O
UP	P	Q5PPP2[U2[OUQP
Q5[U2[U2[O
UP	Q5P!)%fhKb9h)r�r�r�r�r\r�r�r�s& r�*test_close_both_with_unused_items_unforced�7ChannelTests.test_close_both_with_unused_items_unforcedys������w�'�����s�G�e��4����s�F�U��3�
�
�
�y�=�=�
>�
>��O�O�C�d��O�6�?��C�����s�G�e��4��C���C������$��'�
?�
>�s�2C%�%C5	�.C5	c�.�[O[2o[OUQP
Q5[OUQP
Q5[O	UP	P	Q5UO[O29^tt^2[OUQ2PPP2UO[O29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9h)r�r�r�r�r\�rr:r�r]r_r�rNr
r�s& r�(test_close_recv_with_unused_items_forced�5ChannelTests.test_close_recv_with_unused_items_forced�������w�'�����s�G�e��4����s�F�U��3�����$�d��3�
�
�
�y�;�;�
<�
<��N�N�3��(�=�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�=�
<��
<�
<�
<��$�
C0�D�0D	�9D	�D	�D	c�.�[O[2o[OUQP
Q5[OUQP
Q5[O	UP	P	Q5UO[O29^tt^2[OUQ2PPP2UO[O29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9h)r�r�r�r�r\r�r�s& r�(test_close_send_with_unused_items_forced�5ChannelTests.test_close_send_with_unused_items_forced�r�r�c�0�[O[2o[OUQP
Q5[OUQP
Q5[O	UP	P	P	Q5UO[O29^tt^2[OUQ2PPP2UO[O29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9h)r�r�r�r�r\r�r�s& r�(test_close_both_with_unused_items_forced�5ChannelTests.test_close_both_with_unused_items_forced�s������w�'�����s�G�e��4����s�F�U��3�����$�T���>�
�
�
�y�;�;�
<�
<��N�N�3��(�=�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�=�
<��
<�
<�
<�s$�C1�D�1D	�:D	�D	�
D	c���[O[2o[OU2UO	[O
29^tt^2[O
UQ2PPP2UO	[O
29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9h�r�)rr:r�r_r�rNr]r
r�s& r�test_close_never_used�"ChannelTests.test_close_never_used�s������w�'�������
�
�
�y�;�;�
<�
<��N�N�3��(�=�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�=�
<��
<�
<�
<��$�B=�C�=C
	�C
	�C!	�C!	c�>�[O[2o[OUQP
Q5[O2o[O
U[
QUQ022UO[O29^tt^2[OU2PPP2UO[O29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9h)r�r�r*r+)rr:r�r]rr'rr�rNr
r_�r>rr7s&  r�!test_close_by_unassociated_interp�.ChannelTests.test_close_by_unassociated_interp�s������w�'�����s�G�e��4��%�%�'��� � ���5� �E�"
�1�*�	��
�
�y�;�;�
<�
<��N�N�3��=�
�
�
�y�;�;�
<�
<��O�O�C� �=�
<�=�
<��
<�
<�
<�s$�C8�D�8D	�D	�D	�D	c�r�[O[2o[OUQP
Q5[OUQP
Q5[OUQP
Q5[	U2[OUP	Q5UO
[O29^tt^2[OUQ2PPP2UO
[O29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9h)r�r�r�r\r�r�s& r�-test_close_used_multiple_times_by_single_user�:ChannelTests.test_close_used_multiple_times_by_single_user�s������w�'�����s�G�e��4����s�G�e��4����s�G�e��4��C������4��(�
�
�
�y�;�;�
<�
<��N�N�3��(�=�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�=�
<��
<�
<�
<�s$�,D�2D%�D"	�D"	�%D6	�.D6	c���[O[2oUO[O29^tt^2[OQP	Q5PPP2[O
U2UO[O29^tt^2[OUP	Q5PPP2P!)%fhKn9h)%fhP!9h)r�r
)rr:r�r�r�rr_rNr�s& r�.test_channel_list_interpreters_invalid_channel�;ChannelTests.test_channel_list_interpreters_invalid_channel�s������w�'��
�
�
�y�=�=�
>�
>��'�'��4�'�8�?�	�����
�
�
�y�;�;�
<�
<��'�'��$�'�7�=�
<�?�
>��
=�
<�
<�s$�C�C�C	�	C	�C$	�C$	c���[O[2oUO[29^tt^2[OU2PPP2P!)%fhP!9hr)rr:r�r�r�rr�s& r�+test_channel_list_interpreters_invalid_args�8ChannelTests.test_channel_list_interpreters_invalid_args�s@�����w�'��
�
�
�y�
)�
)��'�'��,�*�
)�
)�
)�s�A�A)	�!A)	)r�r�)<rCrDrErFr�r�r�r�rrrrrrr$r'r,r2r9r��skipr=rCrFrJrWr]r`rcrfrprtr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrHrIr�s@rr�r�ps6����8�	D�	6�	6�2�.�&+�2�,@�4+�.)2�V9�,!9�F4�&
.�$�]�]�=�>�.�?�.�&$�
�	'�
'�'�8(�� �
%�*�D
#�$�u��.(� (� (�(��2#�J�4$�R	 �F�0!�(�&5�(� �(�	 �	 �	 � �!� �	8�-�-rr�c�f`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sQs
QsQ
sUsP!)�ChannelReleaseTestsi�a}
- main / interp / other
- run in: current thread / new thread / other thread / different threads
- end / opposite
- force / no force
- used / not used  (associated / not associated)
- empty / emptied / never emptied / partly emptied
- closed / not closed
- released / not released
- creator (interp) / other
- associated interpreter not running
- associated interpreter destroyed
c��[O[2o[OUQP
Q5[	U2[OUP	P	Q5UO
[O29^tt^2[OUQ2PPP2UO
[O29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9h�r�r�r�r\�	rr:r�r]rrr�rNr
r�s& r�test_single_user�$ChannelReleaseTests.test_single_users������w�'�����s�G�e��4��C�����#�D�t��4�
�
�
�y�;�;�
<�
<��N�N�3��(�=�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�=�
<��
<�
<�
<�s$�=C#�C6�#C3	�,C3	�6D	�?D	c
��[O[2o[O2o[O2o[OU[QUQ022[
U[QUQUQ022o[OU[QUQ022UOUO2Q2P!)rrIzU
            import _interpchannels as _channels
            obj, _ = _channels.recv(z )
            _channels.release(z+)
            print(repr(obj))
            z
            _channels.release(rzb'spam')	rr:r�rr'rrr�r)r>rr�r�rs&    r�test_multiple_users�'ChannelReleaseTests.test_multiple_userss������w�'���"�"�$���"�"�$��� � ��f�2��5�!
�.�'�	��#�v�+%�%(�E�*�"�e�$
�'� ���	� � ��f�2�"�e�$
�.�'�	�	
�������i�0rc��[O[2o[OUQP
Q5[	U2[OU2UO
[O29^tt^2[OUQ2PPP2UO
[O29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9hr�rr�s& r�test_no_kwargs�"ChannelReleaseTests.test_no_kwargs&s������w�'�����s�G�e��4��C�����#��
�
�
�y�;�;�
<�
<��N�N�3��(�=�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�=�
<��
<�
<�
<�r�c�h�[O[2o[OUQP
Q5[	U2[OUP	P	Q5UO
[O29^tt^2[OUP	P	Q5PPP2P!)%fhP!9h)r�r�r�)rr:r�r]rrr�rNr�s& r�test_multiple_times�'ChannelReleaseTests.test_multiple_times1s|�����w�'�����s�G�e��4��C�����#�D�t��4�
�
�
�y�;�;�
<�
<����c��4��8�=�
<�
<�
<�s�=B � B1	�)B1	c�|�[O[2o[OUQP
Q5[OUQP
Q5[O	UP	P	Q5UO[O29^tt^2[OU2PPP2P!)%fhP!9h)r�r�r�r�)rr:r�r]rr�rNr
r�s& r�test_with_unused_items�*ChannelReleaseTests.test_with_unused_items:s}�����w�'�����s�G�e��4����s�F�U��3����#�D�t��4�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�
<�
<�s�
B*�*B;	�3B;	c���[O[2o[OU2UO	[O
29^tt^2[O
UQ2PPP2UO	[O
29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9hr)rr:r�rr�rNr]r
r�s& r�test_never_used�#ChannelReleaseTests.test_never_usedCs������w�'�����#��
�
�
�y�;�;�
<�
<��N�N�3��(�=�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�=�
<��
<�
<�
<�rc���[O[2o[OUQP
Q5[O2o[O
U[
QUQ022[U2o[OU2UO[O29^tt^2[OUQ2PPP2UOUQ2P!)%fhK$9h)r�r�r#rr\)rr:r�r]rr'rrrr�rNr�)r>rr7rs&   r�test_by_unassociated_interp�/ChannelReleaseTests.test_by_unassociated_interpLs������w�'�����s�G�e��4��%�%�'��� � ���5�"�e�$
�1�*�	��#������#��
�
�
�y�;�;�
<�
<��N�N�3��(�=�����g�&�=�
<�s�3C&�&C6	�/C6	c
�d�[O[2o[O2o[OU[QUQUQ022UO
[O29^tt^2[OU2PPP2P!)%fhP!9h)zR
            import _interpchannels as _channels
            obj = _channels.send(z9, b'spam', blocking=False)
            _channels.release(r)	rr:r�rr'rr�rNr
rs&  r�test_close_if_unassociated�.ChannelReleaseTests.test_close_if_unassociated[s������w�'���%�%�'��� � ���5"�"%��'�"�e�$
�1�*�	��
�
�y�;�;�
<�
<��N�N�3��=�
<�
<�
<�s�>B�B/	�'B/	c��[O[2o[OUPP
Q5[	U2[OUQP
Q5[OUP	Q5[	U2oUO
UQ2P!)Nr�r�r
)rr:r�r]rrr�)r>rrs&  r�test_partially�"ChannelReleaseTests.test_partiallyhsk�����w�'�����s�D�5��1��C�����s�G�e��4����#�D��)��#�������g�&rc�t�[O[2o[OUQP
Q5[OUQP
Q5[OUQP
Q5[	U2[OUP	P	Q5UO
[O29^tt^2[OUQ2PPP2UO
[O29^tt^2[OU2PPP2P!)%fhKW9h)%fhP!9hrrr�s& r�'test_used_multiple_times_by_single_user�;ChannelReleaseTests.test_used_multiple_times_by_single_userss������w�'�����s�G�e��4����s�G�e��4����s�G�e��4��C�����#�D�t��4�
�
�
�y�;�;�
<�
<��N�N�3��(�=�
�
�
�y�;�;�
<�
<��N�N�3��=�
<�=�
<��
<�
<�
<�s$�-D�3D&�D#	�D#	�&D7	�/D7	rA)rCrDrErF�__doc__rrrr"r%r(r+r.r1r4rHrIr�s@rrr�sK�������"	 �1�(	 �9� � �
'� �	'� � rrc�``�\sQsQsnP
sU1Qks\Q2s\Q2sQs	QQks
QsQsQ	s
Q
sQsQsQ
sUsU9s!)�ChannelCloseFixturei�c�|:�UO%c-oLe[OU2o[OU2o[OU2oUOUUOUUOU-oU%fQo[RU_VV#VE2o[
2Um[2Um	Vgm
U!)r[)�QUICKr-r4r=r;r<r��_preppedro�_state�_known)	r2rVr7rarb�creator�knownr>r?s	&&&&&&  �rr<�ChannelCloseFixture.__new__�s�����9�9�9��E� �)�)�&�1�F��(�(��/�E��(�(��/�E����V��
�
�E��
�
�E��E�
��G��w��s���G�����
�"�n������rc��UO!r�r<rzs&rr��ChannelCloseFixture.state�s���{�{�rc��UO![cASOSO2oSO	S2SmSOt!h9hr)�_cidr��_get_interpreterr>�_new_channel)r>r>s& rr�ChannelCloseFixture.cid�sP��	��9�9����	��+�+�D�L�L�9�G��)�)�'�2�D�I��9�9��	�s��	A�>A�Ac�L�UOU2oUOU2U!r)rF�_prep_interpreter�r>r7s&&r�get_interpreter�#ChannelCloseFixture.get_interpreter�s%���&�&�v�.�����v�&��
rc��Ue
UOoUQ6XcUOOQ6XcP
![UOO2!)Nr
r])rVr�rp�boolrhs&&r�expect_closed_error�'ChannelCloseFixture.expect_closed_error�s@���;��(�(�C��&�=�T�Z�Z�.�.�&�8���D�J�J�%�%�&�&rc�*�UOU2P!r)rJrKs&&r�prep_interpreter�$ChannelCloseFixture.prep_interpreter�s�����v�&rc��V mP!rrB)r>rUr�s&&&r�
record_action�!ChannelCloseFixture.record_action�s���rc�0�[2[2P!r)r	r�rzs&r�clean_up�ChannelCloseFixture.clean_up�s�����rc��UOQ6Xc[O[2![O[2o[	UO
QUQ02[
U2UmUO!)r)z�
                import _interpreters
                cid = _xxsubchannels.create()
                # We purposefully send back an int to avoid tying the
                # channel to the other interpreter.
                _xxsubchannels.send(zN, int(cid), blocking=False)
                del _interpreters
                )r=rr:r�r!rrrE)r>r>�chs&& rrG� ChannelCloseFixture._new_channel�sj���<�<�6�!��#�#�G�,�,��!�!�'�*�B��w�z�z�(%�
&(�D�)�$�
�$�B��D�I��y�y�rc��UQ7c
UO!UQ6Xc
UO!UQ6Xc
UO!SoUOU*oU![c[S29pOS$S!h9h)r[rarb)r[r7)r7rarbr=�KeyErrorr-)r>r7r=s&& rrF�$ChannelCloseFixture._get_interpreter�s����'�'��;�;��
�w�
��:�:��
�w�
��:�:���D�
?����T�*���M���
?�-8��->�>����T�*��M�
?�s�A�	A;�A;�:A;c��UOUO7cP!UOOUO2UOQ6XcP![	UOQUO
Q02P!)Nr)a
            import _interpchannels as channels
            import test.test__interpchannels as helpers
            ChannelState = helpers.ChannelState
            try:
                cid
            except NameError:
                cid = _channels._channel_id(r)rr;�addr=r!rrKs&&rrJ�%ChannelCloseFixture._prep_interpreter�sb���9�9��
�
�%���
�
���&�)�)�$��;�;�&� ���6�9�9�#-�.2�X�X�J�7
��	r)rEr=r;r<r)rCrDrErFr:r<�propertyr�rrLrPrSrVrYrGrFrJrHrIrJrKs@@rr8r8�sf����

�E��*���������
'�'���� 
��rr8zend interp other extra creatorz%these tests take several hours to runc�`�\sQsQsnQsQsQsQsQsQs	QP	-Q	ks
Q
sQsQQks
Q
sQQksQsQsQsQsUsP!)�ExhaustiveChannelTestsi�a�
- main / interp / other
- run in: current thread / new thread / other thread / different threads
- end / opposite
- force / no force
- used / not used  (associated / not associated)
- empty / emptied / never emptied / partly emptied
- closed / not closed
- released / not released
- creator (interp) / other
- associated interpreter not running
- associated interpreter destroyed

- close after unbound
c#�� �,w�	UOQQ2FD+oUw�	UO2FDoV*w�	J	J-	UOQQ2FD+oUw�	UO2FDoV*w�	J	J-	UOQQ2FD�oUw�	UOQQ2FD3oV1*oUw�	UO2FDoVB*w�	J	J5	UOQQ2FD3oV1*oUw�	UO2FDoVB*w�	J	J5	J�	UOQQ2FD�oUw�	UOQQ2FD3oV1*oUw�	UO2FDoVB*w�	J	J5	UOQQ2FD3oV1*oUw�	UO2FDoVB*w�	J	J5	J�	P!3h)r[rarb)�_iter_close_action_sets�_iter_post_close_action_sets�_iter_use_action_sets)r>�closeactions�postactions�
useactions�actionss&    r�iter_action_sets�'ExhaustiveChannelTests.iter_action_setss������!�8�8���I�L���#�@�@�B��"�0�0� C�J�!�8�8��'�J�L���#�@�@�B��"�0�0� C�K��4�4�V�W�E�J��� $� <� <�V�W� M��$�3���
�#'�#D�#D�#F�K�!�/�/�$G�!N�
!%� <� <�W�g� N��$�3���
�#'�#D�#D�#F�K�!�/�/�$G�!O�F��4�4�W�g�F�J��� $� <� <�V�W� M��$�3���
�#'�#D�#D�#F�K�!�/�/�$G�!N�
!%� <� <�W�g� N��$�3���
�#'�#D�#D�#F�K�!�/�/�$G�!O�G�s�G3G5c#�Z �V1o[QQU2,w�	[QQU2,w�	[QQU2[QQU2,w�	[QQU2,w�	[QQU2,w�	[QQU2[QQU2,w�	SFD@oSFD6oSFD,o[QQU2[QQU2[QQU2,w�	J.	J8	JB	SFDVoSFDLoSFDBoSFD8o[QQU2[QQU2[QQU2[QQU2,w�	J:	JD	JN	JX	P!3h)rYr
r]�rQ)r>rr�interpsr�interp4s&&&   rrj�,ExhaustiveChannelTests._iter_use_action_setsJsg����$��
�%���1��	�
�%���1��	�
�%���1��%���1��	�
�%���1��	�
�%���1��	�
�%���1��%���1��	��G�"��&�G�%�e�V�W�=�%�e�V�W�=�%�e�V�W�=��� '�#���G�"��&�G�#*��)�%���A�)�%���A�)�%���A�)�%���A�	��$+� '�#��s�D)D+c#� �QoV1oQFD3oU%cQLQoSFDoSFDo[VhU2,w�	J	J	J5	QFD>o	QFD4o
SFD*oSFD o[U	QU2[U
QU2,w�	J"	J,	J6	J@	P!3h)r
r]r`r_r�r�r^rr)
r>rr�endsrsr��opr7rV�recvop�sendopr
r]s
&&&          rrh�.ExhaustiveChannelTests._iter_close_action_sets{s�������$��"�E�"'��W�B�!���C�%�b�v�6��� �"�#�/�F�2��#�D� '��)�&�&�$�?�)�&�&�$�?���!(�$�3�/�s�B
�A3B
c#�h �QFD%o[QQU2,w�	[QQU2,w�	J'	P!3h)r[rYr
r])r[rbrarrrKs& rri�3ExhaustiveChannelTests._iter_post_close_action_sets�s=���0�F��e�V�V�4��
��e�V�V�4��
�	1�s�02c�>�SFDoUOV2J	P!r)r�)r>�fixrnrUs&&& r�run_actions�"ExhaustiveChannelTests.run_actions�s���F��O�O�C�(�rr�c��UOUO2oUOUOUOUO
2oUO
U2UOQ6XcB[UOUOUUOUQ5oUOV&2P![O[2o[!UO"QUOQ[%UO2Q[%U2Q[%UO2QUQUQUQ02['[(O+[-U2Q2[/[-U22Q	5oUOV&2P!)
r)�r�zB
                result = helpers.run_action(
                    z,
                    z!,
                    hideclosed=z7,
                    )
                _channels.send(zW, result.pending.to_bytes(1, 'little'), blocking=False)
                _channels.send(zB, b'X' if result.closed else b'', blocking=False)
                �little)rrrp)rirVrlr7rarbrSr=r�rrUr�rVrr:r�r!rr�ror��
from_bytesrrO)r>rrUr�rVr7r�rEs&&&$    rr��!ExhaustiveChannelTests.run_action�sJ��� � ����)���&�&�s�z�z�3�9�9�c�i�i�H�����V�$��;�;�&� ������
�
���	�	�%��F�
���f�-��#�#�G�,�D��v�y�y�'��W�W�I���&�-�-�(�)�*��#�Y�K� ��#�)�)�_�%�& � *�|�, � $�v�& � $�v�&�
#�

�"����{�4�'8�(�C��K��-�.��F�
���f�-rc
#�z �,QNoSFD*vq#oQFDoQFDo[VbV4U2w�	J	J	J,	P!3h)r)))r)r7rb)r7r)rb)rrrb)rrr))r[rar>r�)r8)r>�interpretersr7rarbr>rVs&      r�
iter_fixtures�$ExhaustiveChannelTests.iter_fixtures�s@���
��%1� �F�5�7��+�C�-�c�5��Q�Q�,�8�%1�s�9;c�P�U%cQLQo[V1OQ2oUO2%fUOVP
Q5P!UO	[
O29^tt^2UOVP
Q5PPP2P!)%fhP!9h)r`r_r[r�)rQrVrPr�r�rrN)r>rr�rxr_s&&$  r�_close�ExhaustiveChannelTests._close�sq��#�]����b�'�'�6�2���&�&�(�(��O�O�C�5�O�9��"�"�9�#?�#?�@�@�����u��=�A�@�@�@�s�6B�B%	�B%	c��UdUOQ6XCcBUO[O29^tt^2[O	UO
2PPP2UO[O29^tt^2[O
UO
Q2PPP2UO[O29^tt^2[OUO
2PPP2UO[O29^tt^2[OUO
P	Q5PPP2P![UOQ2[UOQ2[UOQ2[UOQ2P!)%fhCK]9h)%fhCK!9h)%fhK�9h)%fhP!9h)Nr)r�r�zo
                with helpers.expect_channel_closed():
                    _channels.recv(cid)
                z�
                with helpers.expect_channel_closed():
                    _channels.send(cid, b'spam', blocking=False)
                zp
                with helpers.expect_channel_closed():
                    _channels.close(cid)
                z|
                with helpers.expect_channel_closed():
                    _channels.close(cid, force=True)
                )
r=r�rrNr
rr]r_r!r)r>rr7s&&&r�_assert_closed_in_interp�/ExhaustiveChannelTests._assert_closed_in_interp�sK���>�V�[�[�F�2��"�"�9�#?�#?�@�@����s�w�w�'�A��"�"�9�#?�#?�@�@����s�w�w��0�A��"�"�9�#?�#?�@�@�������(�A��"�"�9�#?�#?�@�@�������t��4�A�@�
�v�y�y�#�
�
�v�y�y�#�
�
�v�y�y�#�
�
�v�y�y�#�
�+A�@�@��@�@�@��@�@��@�@�@�sG� F3�!G� G�-"G.�3G	�<G	�G	�G	�G+	�$G+	�.G?	�7G?	c��UOUOO2[UOO2FDo[UO2J	UOU2QFD8oUOU2oUOQ6XcJ'UOV2J:	UOQ2oUOV2P!)r[r)�fresh)r[ra)
r�r�rp�rangerrrrr�rLr=)r>rr*r7s&&  r�_assert_closed�%ExhaustiveChannelTests._assert_closed�s�������	�	�(�(�)��s�y�y�(�(�)�A����� �*��%�%�c�*�'�F��(�(��0�F��{�{�f�$���)�)�#�6�	(��$�$�W�-���%�%�c�2rc
#�2 �]oUO2FD�o[2UO2FD�oU]*
oUQ6�cP!U%cEU]*
]*]6Xc[2[V$QO[	U222LMU]*
]*]6Xc[QPQ5[QPQ5[
OO2V$U1w�	J�	U%fJ�[Q2J�	[2P!3h)rr�z({} actions)� rg�.z---)ror�r�r9r��sys�stdout�flush)r>�verbose�irnrs&&   r�_iter_close_tests�(ExhaustiveChannelTests._iter_close_tests�s����
���,�,�.�G��G��)�)�+���Q����t�8����A���{�a�'����!�.�"7�"7��G��"E�F��A���{�a�'��c�r�*��#�2�&��
�
�(8�(8�(:��g�o�%�,��w��e��!/�"	��s&�AD�
D�D�+AD�/AD�<Dc�T�P	[mUO2FDvqoJ	P!)T)r8r:r��r>r�rrns&   r�_skim_close_tests�(ExhaustiveChannelTests._skim_close_testss%��$(��!�#�5�5�7�O�A�G�� 8rc	��UO2FD�vqoUOQOVU229^tt^2UOUO2UOV#2UO
UP
Q5UOU2PPP2UO2J�	P!)%fhK&9h�z	{} {}  {}r��	r�r0r9rSr7r�r�r�rYr�s&   r�
test_close�!ExhaustiveChannelTests.test_closes���#�5�5�7�O�A�G����k�0�0���A�B�B��$�$�S�Z�Z�0�� � ��.����C�u��-��#�#�C�(�
C�
�L�L�N� 8�B�B���AB1	�1C
�:C
c	��UO2FD�vqoUOQOVU229^tt^2UOUO2UOV#2UO
UP	Q5UOU2PPP2UO2J�	P!)%fhK&9hr�r�r�s&   r�test_force_close�'ExhaustiveChannelTests.test_force_close$s���#�5�5�7�O�A�G����k�0�0���A�B�B��$�$�S�Z�Z�0�� � ��.����C�t��,��#�#�C�(�
C�
�L�L�N� 8�B�B�r�rAr)F)rCrDrErFr6rorjrhrir�r�r�r�r�r�r�r�r�r�rHrIr�s@rrfrf�sj����� �� +0�Z/�b�&�)�.�D�.�@R�>��83� �,�

�
�
rrf�__main__),�collectionsr�
contextlibr��textwraprrRrr��test.supportr�
import_moduler�concurrent.interpretersr�test.test__interpretersrrr	�_UNBOUND_CONSTANT_TO_FLAG�UNBOUNDr�rrr!rr-�contextmanagerrOrQror�r�r��TestCaser�r�r�rr8rrfrCr)rArr�<module>r�s~��"��
�����&��'�'�(9�:�	�0����
0�
0��1E�1E�
F����E�� $�-/�
5� �*�]�I�6� �J���+��+�/#�J��0C�D�/#�fE�:�n�.>�?�E�&�d��*!!�H� �x� � � �`,�X�`,�Ji
-�8�i
-�Xb �(�b �Jn�*�%:�%E�G�n�b
���6�7�{�X�{�8�{�|	�z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit