| 128 r d Z ddlmZmZmZmZ ddlmZ ddlm Z m Z ddlmZ ddlm Z G d 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 )dirnamejoinexistssep) FixImport) FromImportsyms)traverse_imports) future_importc e Zd ZdZd Zd ZdS )FixAbsoluteImport c @ | j rdS |d }|j t j k r~t |d s|j d }t |d | |j r5d|j z |_ | t d| dS dS d}d}t | D ]}| | rd}d}|r|r| |d dS t 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" Nimpvaluer .absolute_importFTz#absolute and local imports together)skiptyper import_fromhasattrchildrenprobably_a_local_importr changedr r warningr prefix)selfnoderesultsr have_local have_absolutemod_namenews w/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/libfuturize/fixes/fix_absolute_import.py transformzFixAbsoluteImport.transform sW 9 Fen9((( c7++ &l1o c7++ &++CI66 8 39, 0$77777 8 8 J!M,S11 ) )//99 )!%JJ$(MM N LL'LMMMTC5))CCJ,d333J c X | d rdS | dd d }t | j }t || }t t t | d sdS dt ddd d dfD ]}t ||z r dS dS ) zq Like the corresponding method in the base class, but this also supports Cython modules. r F r z__init__.pyz.pyz.pycz.soz.slz.pydz.pyxT) startswithsplitr filenamer r r )r imp_name base_pathexts r$ r z)FixAbsoluteImport.probably_a_local_importI s t$$ 5>>$**1-DM** H-- d79--}==>> 53uffE Ci#o&&