Current Dir: /snap/core22/2437/usr/lib/python3.10/lib2to3/fixes/__pycache__/
[FILE] fix_apply.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_asserts.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_basestring.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_buffer.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_dict.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_except.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_exec.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_execfile.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_exitfunc.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_filter.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_funcattrs.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_future.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_getcwdu.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_has_key.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_idioms.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_import.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_imports.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_imports2.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_input.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_intern.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_isinstance.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_itertools.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_itertools_imports.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_long.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_map.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_metaclass.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_methodattrs.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_ne.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_next.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_nonzero.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_numliterals.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_operator.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_paren.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_print.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_raise.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_raw_input.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_reduce.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_reload.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_renames.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_repr.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_set_literal.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_standarderror.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_sys_exc.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_throw.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_tuple_params.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_types.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_unicode.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_urllib.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_ws_comma.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_xrange.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_xreadlines.cpython-310.pyc [ edit | delete | rename ]
[FILE] fix_zip.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]
Viewing: /snap/core22/2437/usr/lib/python3.10/lib2to3/fixes/__pycache__/fix_import.cpython-310.pyc
o
��bc� � @ sZ d Z ddlmZ ddlmZmZmZmZ ddlm Z m
Z
mZ dd� ZG dd � d ej
�Zd
S )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 c s� � | g}|rQ|� � }|jtjkr|jV n8|jtjkr(d�dd� |jD ��V n%|jtj kr7|�
|jd � n|jtjkrI|�|jddd� � nt
d��|sdS dS )zF
Walks over all the names imported in a dotted_as_names node.
� c S s g | ]}|j �qS � )�value)�.0�chr r �//usr/lib/python3.10/lib2to3/fixes/fix_import.py�
<listcomp> s z$traverse_imports.<locals>.<listcomp>r N���zunknown node type)�pop�typer
�NAMEr
r �dotted_namer �children�dotted_as_name�append�dotted_as_names�extend�AssertionError)�names�pending�noder r r �traverse_imports s �
�r c s4 e Zd ZdZdZ� fdd�Zdd� Zdd� Z� ZS ) � FixImportTzj
import_from< 'from' imp=any 'import' ['('] any [')'] >
|
import_name< 'import' imp=any >
c s"