관리-도구
편집 파일: fix_import.cpython-312.opt-1.pyc
� �Q�f� � �p � d Z ddlmZ ddlmZmZmZmZ ddlm Z m Z mZ d� Z G d� dej � Zy ) z�Fixer for import statements. If spam is being imported from the local directory, this import: from spam import eggs Becomes: from .spam import eggs And this import: import spam Becomes: from . import spam � )� fixer_base� )�dirname�join�exists�sep)� FromImport�syms�tokenc # �V K � | g}|�r|j � }|j t j k( r|j �� n�|j t j k( r6dj |j D �cg c] }|j �� c}� �� n�|j t j k( r|j |j d � nJ|j t j k( r"|j |j ddd� � nt d� �|r��yyc c}w �w)zF Walks over all the names imported in a dotted_as_names node. � r N���zunknown node type)�pop�typer �NAME�valuer �dotted_namer �children�dotted_as_name�append�dotted_as_names�extend�AssertionError)�names�pending�node�chs �?/opt/alt/python312/lib64/python3.12/lib2to3/fixes/fix_import.py�traverse_importsr s� � �� � �g�G� ��{�{�}���9�9�� � �"��*�*�� �Y�Y�$�*�*� *��'�'�d�m�m�<�m��2�8�8�m�<�=�=� �Y�Y�$�-�-� -��N�N�4�=�=��+�,� �Y�Y�$�.�.� .��N�N�4�=�=��2��.�/� �!4�5�5� �� =�s �A9D)�;D$�BD)�"D)c �2 � � e Zd ZdZdZ� fd�Zd� Zd� Z� xZS )� FixImportTzj import_from< 'from' imp=any 'import' ['('] any [')'] > | import_name< 'import' imp=any > c �T �� t t | � ||� d|j v | _ y )N�absolute_import)�superr! � start_tree�future_features�skip)�self�tree�name� __class__s �r r% zFixImport.start_tree/ s&