← Back
Editing: deepreload.cpython-311.pyc
� �@�c�$ � �� � d Z ddlZddlmZ ddlZddlZddlmZ ddl m Z ddlZej Zed� � � Z d� Zd� Zi ad � Zd � Zd� Zdd �Zi ad� Zej Zg ej �d�d�d�d�d�d�R fd�ZdS )a� Provides a reload() function that acts recursively. Python's normal :func:`python:reload` function only reloads the module that it's passed. The :func:`reload` function in this module also reloads everything imported from that module, which is useful when you're changing files deep inside a package. To use this as your default reload function, type this:: import builtins from IPython.lib import deepreload builtins.reload = deepreload.reload A reference to the original :func:`python:reload` is stored in this module as :data:`original_reload`, so you can restore it later. This code is almost entirely based on knee.py, which is a Python re-implementation of hierarchical module import. � N)�contextmanager)� ModuleType)�warnc # �~ K � t j }| t _ d V � |t _ d S # |t _ w xY w)N)�builtin_mod� __import__)� new_import�saved_imports �8/usr/lib/python3/dist-packages/IPython/lib/deepreload.py�replace_import_hookr ( sF � � � ��)�L�'�K��.� ����!-���������-�-�-�-s �. �<c �\ � |}|rt | t � � sdS | � dd� � }|�Lt |d� � st d� � �t |� � dk r|dk rt d� � �dS |}njd| vrdS | d }d | v r|x| d<