File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -748,15 +748,25 @@ def echo(x):
748748 #XXX: backwards compatibility for IPython < 1.0
749749 if not hasattr (kc , 'iopub_channel' ):
750750 kc .iopub_channel = kc .sub_channel
751- print km
752- self .send_ipython ('# bpython connected' )
753751 self .km = km
754752 self .kc = kc
755- # TODO: hide this from user_ns
756- self .ipython_set_pid ()
753+ print km
754+ msg_id = self .send_ipython ('# bpython connected' )
755+ try :
756+ child = self .ipython_get_child_msg (msg_id )
757+ except Empty :
758+ import sys
759+ sys .stderr .write ("\n " )
760+ sys .stderr .write ("""Unable to connect to IPython:
761+ Either it's busy executing, or you haven't started one.
762+ use `ipython console` in another shell first, or open a
763+ new IPython Notebook""" )
764+ sys .exit (1 )
765+
757766 self .send_ipython (bipy_func , silent = True )
758767 # TODO: get a proper history navigator
759768 #self.rl_history = IPythonHistory(kc)
769+ self .ipython_set_pid ()
760770
761771 return km
762772
@@ -1875,3 +1885,4 @@ def load_urwid_command_map(config):
18751885"""
18761886if __name__ == '__main__' :
18771887 sys .exit (main ())
1888+
Original file line number Diff line number Diff line change 3838 setup_kwargs ['install_requires' ] = [
3939 'Pygments >= 1.6' ,
4040 'urwid >= 1.1.1' ,
41- 'bipython >= 0.12' ,
41+ 'bpython >= 0.12' ,
4242 'ipython >= 0.12' ,
4343 ]
4444
4545if __name__ == '__main__' :
46- with open ('README.md' ). read () as f :
46+ with open ('README.md' ) as f :
4747 descr = f .read ()
4848 descr = descr [:descr .find ('TODO' )]
4949 setup (
You can’t perform that action at this time.
0 commit comments