IPython 3 compatibility

This commit is contained in:
Min RK 2015-06-16 12:12:02 -07:00 committed by sftnight
parent ac67953d30
commit 0e5bc4dda9

View File

@ -10,12 +10,19 @@ import sys
from tornado.ioloop import IOLoop
from ipykernel.kernelbase import Kernel
try:
from ipykernel.kernelbase import Kernel
except ImportError:
from IPython.kernel.zmq.kernelbase import Kernel
from pexpect import replwrap, EOF
__version__ = '0.0.1'
from traitlets import Unicode
try:
from traitlets import Unicode
except ImportError:
from IPython.utils.traitlets import Unicode
class ClingError(Exception):
def __init__(self, buf):
@ -187,7 +194,10 @@ class ClingKernel(Kernel):
def main():
"""launch a cling kernel"""
try:
from ipykernel.kernelapp import IPKernelApp
except ImportError:
from IPython.kernel.zmq.kernelapp import IPKernelApp
IPKernelApp.launch_instance(kernel_class=ClingKernel)