Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/test_modulefinder.cpython-38.opt-1.pyc
U

>��g�0�@sddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
Z
e��Zeej
�ej�gZdddddgdgdgd	gZdddddd
gdgdgdgZdddd
dddgddggdgZdddddddd
ddg	ddggdgZdd
dddddddddddgggdgZdddddddddddd dd!g
ggd"gZdddgd#ggd$gZdddgggd%gZddgggd&gZddddgd'ggd(gZddddd)gdggd*gZd+d+d,gggd-gZd+d+d,gggd.gZd/d/d,gggd0d1�d2�gZd3d4�Z d5d6�Z!Gd7d8�d8ej"�Z#e$d9k�re�%�dS):�N)�supportza.module�a�sys�b�czb.somethingz�a/__init__.py
a/module.py
                                from b import something
                                from c import something
b/__init__.py
                                from sys import *
Z
__future__aa/__init__.py
a/module.py
                                from b import something
                                from c import something
b/__init__.py
                                from __future__ import absolute_import
                                from sys import *
za.bza.cZmymoduleZblahblahamymodule.py
a/__init__.py
                                import blahblah
                                from a import b
                                import c
a/module.py
                                import sys
                                from a import b as x
                                from a.c import sillyname
a/b.py
a/c.py
                                from a.module import x
                                import mymodule as sillyname
                                from sys import version_info
zb.xzb.yzb.z�gc�zajmymodule.py
a/__init__.py
a/module.py
                                from __future__ import absolute_import
                                import sys # sys
                                import blahblah # fails
                                import gc # gc
                                import b.x # b.x
                                from b import y # b.y
                                from b.z import * # b.z.*
a/gc.py
a/sys.py
                                import mymodule
a/b/__init__.py
a/b/x.py
a/b/y.py
a/b/z.py
b/__init__.py
                                import z
b/unused.py
b/x.py
b/y.py
b/z.py
za.b.yza.b.zza.b.cz
a.b.c.moduleCza.b.c.dza.b.c.eza.b.xa�mymodule.py
a/__init__.py
                                from .b import y, z # a.b.y, a.b.z
a/module.py
                                from __future__ import absolute_import # __future__
                                import gc # gc
a/gc.py
a/sys.py
a/b/__init__.py
                                from ..b import x # a.b.x
                                #from a.b.c import moduleC
                                from .c import moduleC # a.b.moduleC
a/b/x.py
a/b/y.py
a/b/z.py
a/b/g.py
a/b/c/__init__.py
                                from ..c import e # a.b.c.e
a/b/c/moduleC.py
                                from ..c import d # a.b.c.d
a/b/c/d.py
a/b/c/e.py
a/b/c/x.py
za.sysza.b.c.fz	a.anothera�mymodule.py
a/__init__.py
                                from . import sys # a.sys
a/another.py
a/module.py
                                from .b import y, z # a.b.y, a.b.z
a/gc.py
a/sys.py
a/b/__init__.py
                                from .c import moduleC # a.b.c.moduleC
                                from .c import d # a.b.c.d
a/b/x.py
a/b/y.py
a/b/z.py
a/b/c/__init__.py
                                from . import e # a.b.c.e
a/b/c/moduleC.py
                                #
                                from . import f   # a.b.c.f
                                from .. import x  # a.b.x
                                from ... import another # a.another
a/b/c/d.py
a/b/c/e.py
a/b/c/f.py
za.barz�a/__init__.py
                                def foo(): pass
a/module.py
                                from . import foo
                                from . import bar
zza/__init__.py
                                def foo(): pass
a/module.py
                                from . import *
�zb.modulez�a/__init__.py
a/module.py
                                import b.module
b/__init__.py
b/module.py
                                ?  # SyntaxError: invalid syntax
zb.cz�a/__init__.py
a/module.py
                                import c
                                from b import c
b/__init__.py
b/c.py
Za_utf8Zb_utf8u�a_utf8.py
                                # use the default of utf8
                                print('Unicode test A code point 2090 ₐ that is not valid in cp1252')
                                import b_utf8
b_utf8.py
                                # use the default of utf8
                                print('Unicode test B code point 2090 ₐ that is not valid in cp1252')
uza_utf8.py
                                # coding=utf8
                                print('Unicode test A code point 2090 ₐ that is not valid in cp1252')
                                import b_utf8
b_utf8.py
                                # use the default of utf8
                                print('Unicode test B code point 2090 ₐ that is not valid in cp1252')
Za_cp1252s�a_cp1252.py
                                # coding=cp1252
                                # 0xe2 is not allowed in utf8
                                print('CP1252 test P�t�')
                                import b_utf8
u�b_utf8.py
                                # use the default of utf8
                                print('Unicode test A code point 2090 ₐ that is not valid in cp1252')
�utf-8c
CsVtj�|�}zt�|�Wn0tk
rJ}z|jtjkr:�W5d}~XYnXt|d�S)N�wb)�os�path�dirname�makedirs�OSError�errno�EEXIST�open)r
r�e�r�5/opt/cppython/lib/python3.8/test/test_modulefinder.py�	open_file%srcCs�d}z�|��D]z}t|�tkr(|�d�}|�d�s<|�d�rP|�|��d�q|r\|��t|�tkrr|�d�}t	t
j�t
|����}qW5|r�|��XdS)Nr
� �	�
)�close�
splitlines�type�bytes�encode�
startswith�write�strip�decoderrr
�join�TEST_DIR)�sourceZofi�linerrr�create_package/s

r(c@s�eZdZddgejfdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'S)(�ModuleFinderTestFrc	Cs�|\}}}}	}
t|
�zn|t||d�}|�|�|r<|��tt|��}t|j	�}|�
||�|��\}
}|�
|
|�|�
||	�W5t�t�XdS)N)r
�debug�
replace_paths)r(�shutil�rmtreer%�	TEST_PATHZimport_hook�report�sorted�set�modulesZassertEqualZany_missing_maybe)�self�infor/r*r+�modulefinder_classZimport_thisr2�missingZ
maybe_missingr&Zmf�foundZbad�mayberrr�_do_testBs �


zModuleFinderTest._do_testcCs|�t�dS�N)r9�package_test�r3rrr�test_package`szModuleFinderTest.test_packagecCs|�t�dSr:)r9�
maybe_testr<rrr�
test_maybecszModuleFinderTest.test_maybecCs|�t�dSr:)r9�maybe_test_newr<rrr�test_maybe_newfszModuleFinderTest.test_maybe_newcCs|�t�dSr:)r9�absolute_import_testr<rrr�test_absolute_importsisz&ModuleFinderTest.test_absolute_importscCs|�t�dSr:)r9�relative_import_testr<rrr�test_relative_importslsz&ModuleFinderTest.test_relative_importscCs|�t�dSr:)r9�relative_import_test_2r<rrr�test_relative_imports_2osz(ModuleFinderTest.test_relative_imports_2cCs|�t�dSr:)r9�relative_import_test_3r<rrr�test_relative_imports_3rsz(ModuleFinderTest.test_relative_imports_3cCs|�t�dSr:)r9�relative_import_test_4r<rrr�test_relative_imports_4usz(ModuleFinderTest.test_relative_imports_4cCs|�t�dSr:)r9�syntax_error_testr<rrr�test_syntax_errorxsz"ModuleFinderTest.test_syntax_errorcCs|�t�dSr:)r9�same_name_as_bad_testr<rrr�test_same_name_as_bad{sz&ModuleFinderTest.test_same_name_as_badc	Csxtj�td�}|tjjd}|tjjd}t|��}|�	d�
d��W5QRXtj||d�t�
|�|�t�dS)Nrrztesting_modulefinder = True
r
)�cfile)rr
r$r%�	importlib�	machinery�SOURCE_SUFFIXES�BYTECODE_SUFFIXESrr!r�
py_compile�compile�remover9�
bytecode_test)r3�	base_path�source_path�
bytecode_path�filerrr�
test_bytecode~s

zModuleFinderTest.test_bytecodec	Csntj�tdd�}tj�tdd�}t���}|jtd||fgd�W5QRX|��}d||f}|�	||�dS)Nrz	module.pyzspam.py�)r*r+zco_filename %r changed to %r)
rr
r$r%rZcaptured_stdoutr9r>�getvalueZassertIn)r3Zold_path�new_path�outputZexpectedrrr�test_replace_paths�s
�z#ModuleFinderTest.test_replace_pathscCs,dddgggdttd��g}|�|�dS)NrrzVa.py
                                %r
                                import b
b.py
i)�list�ranger9)r3Zextended_opargs_testrrr�test_extended_opargs�s
��
z%ModuleFinderTest.test_extended_opargscCs|�t�dSr:)r9�coding_default_utf8_testr<rrr�test_coding_default_utf8�sz)ModuleFinderTest.test_coding_default_utf8cCs|�t�dSr:)r9�coding_explicit_utf8_testr<rrr�test_coding_explicit_utf8�sz*ModuleFinderTest.test_coding_explicit_utf8cCs|�t�dSr:)r9�coding_explicit_cp1252_testr<rrr�test_coding_explicit_cp1252�sz,ModuleFinderTest.test_coding_explicit_cp1252cCs$Gdd�dtj�}|jt|d�dS)Ncs(eZdZ�fdd�Z�fdd�Z�ZS)zAModuleFinderTest.test_load_module_api.<locals>.CheckLoadModuleApicst�j||�dSr:)�super�__init__)r3�args�kwds��	__class__rrrm�szJModuleFinderTest.test_load_module_api.<locals>.CheckLoadModuleApi.__init__cs|\}}}t��||||�Sr:)rl�load_module)r3Zfqname�fp�pathname�	file_info�suffix�moderrprrrr�s
zMModuleFinderTest.test_load_module_api.<locals>.CheckLoadModuleApi.load_module)�__name__�
__module__�__qualname__rmrr�
__classcell__rrrpr�CheckLoadModuleApi�sr|)r5)�modulefinder�ModuleFinderr9rB)r3r|rrr�test_load_module_api�s	z%ModuleFinderTest.test_load_module_apiN)rxryrzr}r~r9r=r?rArCrErGrIrKrMrOr]rbrergrirkrrrrrr)As$


r)�__main__)&rrZimportlib.machineryrQrUr,Zunittest�tempfile�testrr}�mkdtempr%r
r�__file__r.r>r@r;rBrDrFrHrJrXrLrNrfrhrrjrr(ZTestCaser)rx�mainrrrr�<module>s�������!��%�	�(��
�	�
������
s


F1le Man4ger