403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/test_importlib/source/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/test_importlib/source/__pycache__/test_finder.cpython-36.pyc
3

�w2_G"�@s�ddlmZddlmZejd�ZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
Z
ddlZGdd�dej�ZGd	d
�d
e�Zejeed�\ZZGdd
�d
e�Zejeed�\ZZGdd�de�Zejeed�\ZZedkr�e
j�dS)�)�abc)�utilzimportlib.machinery�N)�make_legacy_pycc@s�eZdZdZdd�Zdd�Zd"ddd�dd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zejejdkd�dd��Zd d!�ZdS)#�FinderTestsaEFor a top-level module, it should just be found directly in the
    directory being searched. This is true for a directory with source
    [top-level source], bytecode [top-level bc], or both [top-level both].
    There is also the possibility that it is a package [top-level package], in
    which case there will be a directory with the module name and an
    __init__.py file. If there is a directory without an __init__.py an
    ImportWarning is returned [empty dir].

    For sub-modules and sub-packages, the same happens as above but only use
    the tail end of the name [sub module] [sub package] [sub empty].

    When there is a conflict between a package and module having the same name
    in the same directory, the package wins out [package over module]. This is
    so that imports of modules within the package can occur rather than trigger
    an import error.

    When there is a package and module with the same name, always pick the
    package over the module [package over module]. This is so that imports from
    the package have the possibility of succeeding.

    cCs2|jj|jjf|jj|jjfg}|jj|f|��S)N)�	machinery�SourceFileLoader�SOURCE_SUFFIXES�SourcelessFileLoader�BYTECODE_SUFFIXES�
FileFinder)�self�root�loader_details�r�K/opt/alt/python36/lib64/python3.6/test/test_importlib/source/test_finder.py�
get_finder)s
zFinderTests.get_findercCs|j|�}|j||dd�S)NT)�loader_only)r�_find)r
r�module�finderrrr�import_0s
zFinderTests.import_N)�compile_�unlinkc	Cs�|dkr|h}tj|���}|r:x|D]}tj||�q$W|r�x\|D]T}tj||�yt||�WqDtk
r�}z|jtj	kr��WYdd}~XqDXqDW|j
|d|�}|jt|d��|SQRXdS)z�Test the finding of 'test' with the creation of modules listed in
        'create'.

        Any names listed in 'compile_' are byte-compiled. Modules
        listed in 'unlink' have their source files deleted.

        Nz.root�load_module)
r�create_modules�
py_compile�compile�osrr�OSError�errno�ENOENTr�
assertTrue�hasattr)	r
ZtestZcreaterr�mapping�name�error�loaderrrr�run_test4s"

zFinderTests.run_testcCs2|jd�|jddhdhd�|jddhd�dS)NZ	top_level)rr)r)r()r
rrr�test_moduleQs


zFinderTests.test_modulecCs>|jddh�|jddhdhdhd�|jddhdhd�dS)NZpkgzpkg.__init__)rr)r)r()r
rrr�test_package[s
zFinderTests.test_packagecCsHtjdd��2}tjj|d�}|j|d�}|jt|d��WdQRXdS)Nzpkg.__init__zpkg.subr)rrr�path�dirnamerr"r#)r
r$�pkg_dirr'rrr�test_module_in_packageesz"FinderTests.test_module_in_packagecCsLtjdd�}|�2}tjj|d�}|j|d�}|jt|d��WdQRXdS)Nzpkg.__init__zpkg.sub.__init__zpkg.subr)rrrr+r,rr"r#)r
�contextr$r-r'rrr�test_package_in_packagels
z#FinderTests.test_package_in_packagecCs0d}|j|dj|�|h�}|jd|j|��dS)N�_tempz{0}.__init__�__init__)r(�formatZassertIn�get_filename)r
r%r'rrr�test_package_over_moduletsz$FinderTests.test_package_over_modulec
Cs4tjd�� }|j|dd�}|j|�WdQRXdS)NZblahz.rootZ
sdfsadsadf)rrr�assertIsNone)r
r$Znothingrrr�test_failureyszFinderTests.test_failurecCsp|jjd|jj|jjf�}tdd��}|jd�WdQRXz$|j|ddd�}|jt|d��Wdt	j
d�XdS)	N�zmod.py�wz# test file for importlib�modT)rr)rrrr	�open�writerr"r#rr)r
r�filer'rrr�test_empty_string_for_dir~sz%FinderTests.test_empty_string_for_dircCs:|jjd|jj|jjf�}d|_|j�|j|jd�dS)Nr8�*����)rrrr	�_path_mtime�invalidate_caches�assertEqual)r
rrrr�test_invalidate_caches�s
z"FinderTests.test_invalidate_cachescCs`d}tj|��.}|j|d�}|j|ddd�}|j|�WdQRX|j|ddd�}|j|�dS)Nr:z.rootT)r)rrrrZassertIsNotNoner6)r
r:r$r�foundrrr�test_dir_removal_handling�sz%FinderTests.test_dir_removal_handlingZwin32z>os.chmod() does not support the needed arguments under Windowscsntj�}tj|j�j��fdd�}|j||�tj|jtjtj	B�|j
|j�}|j|d�}|j||j
�dS)Ncs tj|j��|jddd�dS)z�Cleanup function for the temporary directory.

            Since we muck with the permissions, we want to set them back to
            their original values to make sure the directory can be properly
            cleaned up.

            N)r�chmodr%�__exit__)�tempdir)�
original_moderr�cleanup�sz3FinderTests.test_no_read_directory.<locals>.cleanup�doesnotexist)�tempfileZTemporaryDirectoryr�statr%�st_modeZ
addCleanuprH�S_IWUSR�S_IXUSRrrrD�	NOT_FOUND)r
rJrLrrFr)rKr�test_no_read_directory�s
z"FinderTests.test_no_read_directoryc
Cs>tj��,}|j|j�}|j|d�}|j||j�WdQRXdS)NrM)rNZNamedTemporaryFilerr%rrDrS)r
Zfile_objrrFrrr�test_ignore_file�s
zFinderTests.test_ignore_file)N)�__name__�
__module__�__qualname__�__doc__rrr(r)r*r.r0r5r7r>rErG�unittestZ
skipUnless�sys�platformrTrUrrrrrs 

		rc@seZdZdZddd�ZdS)�FinderTestsPEP451NFcCs|j|�}|dk	r|jS|S)N)�	find_specr')r
rr%r�specrrrr�s
zFinderTestsPEP451._find)F)rVrWrXrSrrrrrr]�sr])rc@seZdZdgfZddd�ZdS)�FinderTestsPEP420NFc
Cs:tj��(tjdt�|j|�}|r,|dS|SQRXdS)N�ignorer)�warnings�catch_warnings�simplefilter�DeprecationWarning�find_loader)r
rr%rZloader_portionsrrrr�s

zFinderTestsPEP420._find)F)rVrWrXrSrrrrrr`�sr`c@seZdZdZddd�ZdS)�FinderTestsPEP302NFc
Cs*tj��tjdt�|j|�SQRXdS)Nra)rbrcrdre�find_module)r
rr%rrrrr�s
zFinderTestsPEP302._find)F)rVrWrXrSrrrrrrg�srg�__main__)r8rrZimport_importlibrr rrrOr[rNZtest.supportrrZrbrr]Z	test_bothZFrozen_FinderTestsPEP451ZSource_FinderTestsPEP451r`ZFrozen_FinderTestsPEP420ZSource_FinderTestsPEP420rgZFrozen_FinderTestsPEP302ZSource_FinderTestsPEP302rV�mainrrrr�<module>s*
.


Youez - 2016 - github.com/yon3zu
LinuXploit