HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_modulefinder.cpython-310.opt-1.pyc
o

�i�0�@s�ddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
Z
e��Zeej
�ej�gZdgd�dgdgdgZdgd�dgdgd	gZdgd
�ddggdgZdgd
�ddggdgZdgd�ggdgZdgd�ggdgZdddgdggdgZdddgggdgZddgggdgZdgd�dggdgZdgd�dggdgZdddgggd gZdddgggd!gZd"d"dgggd#d$�d%�gZd&d'�Z d(d)�Z!Gd*d+�d+ej"�Z#e$d,kr�e�%�dSdS)-�N)�support�a.module)�ar�sys�b�czb.somethingz�a/__init__.py
a/module.py
                                from b import something
                                from c import something
b/__init__.py
                                from sys import *
)rrrr�
__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 *
)r�a.bza.crZmymodulerZblahblahamymodule.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
)	rrrzb.xzb.yzb.zrr�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
)rrrr	�a.b.y�a.b.z�a.b.c�
a.b.c.moduleC�a.b.c.d�a.b.c.e�a.b.xr
a�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
)
rrza.sysr	rr
rrrrza.b.c.frz	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
rza.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 *
�)rrrzb.modulez�a/__init__.py
a/module.py
                                import b.module
b/__init__.py
b/module.py
                                ?  # SyntaxError: invalid syntax
)rrrzb.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
CsXtj�|�}zt�|�Wnty&}z
|jtjkr�WYd}~nd}~wwt|d�S)N�wb)�os�path�dirname�makedirs�OSError�errno�EEXIST�open)rr�e�r�3/usr/local/lib/python3.10/test/test_modulefinder.py�	open_file%s���
r!cCs�d}zM|��D]=}t|�tkr|�d�}|�d�s|�d�r(|�|��d�q|r.|��t|�tkr9|�d�}t	t
j�t
|����}qW|rN|��dSdS|rW|��ww)Nr� �	�
)�
splitlines�type�bytes�encode�
startswith�write�strip�close�decoder!rr�join�TEST_DIR)�sourceZofi�linerrr �create_package/s$

��
�r2c@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|
�z=|t||d�}|�|�|r|��tt|��}t|j�}|�||�|��\}
}|�|
|�|�||	�Wt	�
t�dSt	�
t�w)N)r�debug�
replace_paths)r2�	TEST_PATHZimport_hook�report�sorted�set�modulesZassertEqualZany_missing_maybe�shutil�rmtreer/)�self�infor7r4r5�modulefinder_classZimport_thisr:�missingZ
maybe_missingr0Zmf�foundZbad�mayberrr �_do_testBs �


zModuleFinderTest._do_testcC�|�t�dS�N)rC�package_test�r=rrr �test_package`�zModuleFinderTest.test_packagecCrDrE)rC�
maybe_testrGrrr �
test_maybecrIzModuleFinderTest.test_maybecCrDrE)rC�maybe_test_newrGrrr �test_maybe_newfrIzModuleFinderTest.test_maybe_newcCrDrE)rC�absolute_import_testrGrrr �test_absolute_importsirIz&ModuleFinderTest.test_absolute_importscCrDrE)rC�relative_import_testrGrrr �test_relative_importslrIz&ModuleFinderTest.test_relative_importscCrDrE)rC�relative_import_test_2rGrrr �test_relative_imports_2orIz(ModuleFinderTest.test_relative_imports_2cCrDrE)rC�relative_import_test_3rGrrr �test_relative_imports_3rrIz(ModuleFinderTest.test_relative_imports_3cCrDrE)rC�relative_import_test_4rGrrr �test_relative_imports_4urIz(ModuleFinderTest.test_relative_imports_4cCrDrE)rC�syntax_error_testrGrrr �test_syntax_errorxrIz"ModuleFinderTest.test_syntax_errorcCrDrE)rC�same_name_as_bad_testrGrrr �test_same_name_as_bad{rIz&ModuleFinderTest.test_same_name_as_badcCs�tj�td�}|tjjd}|tjjd}t|��}|�	d�
d��Wd�n1s.wYtj||d�t�
|�|�t�dS)Nrrztesting_modulefinder = True
r)�cfile)rrr.r/�	importlib�	machinery�SOURCE_SUFFIXES�BYTECODE_SUFFIXESr!r*r(�
py_compile�compile�removerC�
bytecode_test)r=�	base_path�source_path�
bytecode_path�filerrr �
test_bytecode~s
�
zModuleFinderTest.test_bytecodecCs�tj�tdd�}tj�tdd�}t���}|jtd||fgd�Wd�n1s*wY|��}d||f}|�	||�dS)Nrz	module.pyzspam.py�)r4r5zco_filename %r changed to %r)
rrr.r/rZcaptured_stdoutrCrJ�getvalueZassertIn)r=Zold_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�rangerC)r=Zextended_opargs_testrrr �test_extended_opargs�s
��
z%ModuleFinderTest.test_extended_opargscCrDrE)rC�coding_default_utf8_testrGrrr �test_coding_default_utf8�rIz)ModuleFinderTest.test_coding_default_utf8cCrDrE)rC�coding_explicit_utf8_testrGrrr �test_coding_explicit_utf8�rIz*ModuleFinderTest.test_coding_explicit_utf8cCrDrE)rC�coding_explicit_cp1252_testrGrrr �test_coding_explicit_cp1252�rIz,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|i|��dSrE)�super�__init__)r=�args�kwds��	__class__rr ry�szJModuleFinderTest.test_load_module_api.<locals>.CheckLoadModuleApi.__init__cs|\}}}t��||||�SrE)rx�load_module)r=Zfqname�fp�pathname�	file_info�suffix�moder&r|rr r~�s
zMModuleFinderTest.test_load_module_api.<locals>.CheckLoadModuleApi.load_module)�__name__�
__module__�__qualname__ryr~�
__classcell__rrr|r �CheckLoadModuleApi�sr�)r?)�modulefinder�ModuleFinderrCrN)r=r�rrr �test_load_module_api�s	z%ModuleFinderTest.test_load_module_apiN)r�r�r�r�r�rCrHrKrMrOrQrSrUrWrYr[rirnrqrsrurwr�rrrr r3As&


r3�__main__)&rr�importlib.machineryr]rar;Zunittest�tempfile�testrr��mkdtempr/rr�__file__r6rJrLrFrNrPrRrTrVrdrXrZrrrtr(rvr!r2ZTestCaser3r��mainrrrr �<module>s�����!�%	�(��
�	������
s�