##// END OF EJS Templates
more unique filename for test...
more unique filename for test I actually had a filename named /tmp/foo and this test failed, because it was owned by a different user, hence writing to it (and deleting it) failed. Using /tmp/foo_iptest makes it a bit more unique, and a lot less likely to be on a given system.

File last commit:

r10613:1df365aa
r10915:0ef9e081
Show More
getipython.py
30 lines | 1.1 KiB | text/x-python | PythonLexer
# encoding: utf-8
"""Simple function to call to get the current InteractiveShell instance
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import warnings
#-----------------------------------------------------------------------------
# Classes and functions
#-----------------------------------------------------------------------------
def get_ipython():
"""Get the global InteractiveShell instance.
Returns None if no InteractiveShell instance is registered.
"""
from IPython.core.interactiveshell import InteractiveShell
if InteractiveShell.initialized():
return InteractiveShell.instance()