Format: application/x-python-code
1 o
2
3 ��h�$ � @ s� d Z ddlZddlmZ ddlZddlZddlmZ ddl m
4 Z
5 ddlZejZedd� �Z
6 dd � Zd
7 d� Zi add
8 � Zdd� Zdd� Zddd�Zi add� ZejZg ej�d�d�d�d�d�d�R fdd�ZdS ) a�
9 Provides a reload() function that acts recursively.
10
11 Python's normal :func:`python:reload` function only reloads the module that it's
12 passed. The :func:`reload` function in this module also reloads everything
13 imported from that module, which is useful when you're changing files deep
14 inside a package.
15
16 To use this as your default reload function, type this::
17
18 import builtins
19 from IPython.lib import deepreload
20 builtins.reload = deepreload.reload
21
22 A reference to the original :func:`python:reload` is stored in this module as
23 :data:`original_reload`, so you can restore it later.
24
25 This code is almost entirely based on knee.py, which is a Python
26 re-implementation of hierarchical module import.
27 � N)�contextmanager)�
28 ModuleType)�warnc c s* � t j}| t _z d V W |t _d S |t _w )N)�builtin_mod�
29 __import__)Z
30 new_importZsaved_import� r �Lc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/lib/deepreload.py�replace_import_hook( s �r c C s� |}|r t | t�sdS | �dd�}|dur1t|d�std��t|�dkr.|dkr,td��dS |}n<d| vr7dS | d }d | v rF| | d<