HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/libfuturize/fixes/__pycache__/fix_absolute_import.cpython-310.pyc
o

,�]D�@sddZddlmZmZmZmZddlmZddlm	Z	m
Z
ddlmZddlm
Z
Gdd�de�Zd	S)
a�
Fixer for import statements, with a __future__ import line.

Based on lib2to3/fixes/fix_import.py, but extended slightly so it also
supports Cython modules.

If spam is being imported from the local directory, this import:
    from spam import eggs
becomes:
    from __future__ import absolute_import
    from .spam import eggs

and this import:
    import spam
becomes:
    from __future__ import absolute_import
    from . import spam
�)�dirname�join�exists�sep)�	FixImport)�
FromImport�syms)�traverse_imports)�
future_importc@s eZdZdZdd�Zdd�ZdS)�FixAbsoluteImport�	cCs�|jrdS|d}|jtjkr7t|d�s|jd}t|d�r|�|j�r5d|j|_|��t	d|�dSdSd}d}t
|�D]}|�|�rId}q?d}q?|rX|rV|�|d	�dStd|g�}|j
|_
t	d|�|S)
z�
        Copied from FixImport.transform(), but with this line added in
        any modules that had implicit relative imports changed:

            from __future__ import absolute_import"
        N�imp�valuer�.�absolute_importFTz#absolute and local imports together)�skip�typer�import_from�hasattr�children�probably_a_local_importr�changedr
r	�warningr�prefix)�self�node�resultsr
�
have_local�
have_absolute�mod_name�new�r!�G/usr/lib/python3/dist-packages/libfuturize/fixes/fix_absolute_import.py�	transforms4


��

zFixAbsoluteImport.transformcCsv|�d�rdS|�dd�d}t|j�}t||�}ttt|�d��s$dSdtddd	d
dfD]}t||�r8dSq-dS)
zq
        Like the corresponding method in the base class, but this also
        supports Cython modules.
        rF�rz__init__.pyz.pyz.pycz.soz.slz.pydz.pyxT)�
startswith�splitr�filenamerrr)r�imp_name�	base_path�extr!r!r"rIs


�z)FixAbsoluteImport.probably_a_local_importN)�__name__�
__module__�__qualname__�	run_orderr#rr!r!r!r"rs*rN)�__doc__�os.pathrrrr�lib2to3.fixes.fix_importr�lib2to3.fixer_utilrrr	�libfuturize.fixer_utilr
rr!r!r!r"�<module>s