Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/IPython/core/getipython.py: 40%

5 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-04-20 06:09 +0000

1# encoding: utf-8 

2"""Simple function to call to get the current InteractiveShell instance 

3""" 

4 

5#----------------------------------------------------------------------------- 

6# Copyright (C) 2013 The IPython Development Team 

7# 

8# Distributed under the terms of the BSD License. The full license is in 

9# the file COPYING, distributed as part of this software. 

10#----------------------------------------------------------------------------- 

11 

12#----------------------------------------------------------------------------- 

13# Classes and functions 

14#----------------------------------------------------------------------------- 

15 

16 

17def get_ipython(): 

18 """Get the global InteractiveShell instance. 

19 

20 Returns None if no InteractiveShell instance is registered. 

21 """ 

22 from IPython.core.interactiveshell import InteractiveShell 

23 if InteractiveShell.initialized(): 

24 return InteractiveShell.instance()