##// END OF EJS Templates
Revert Shell.py changes, they don't work.
fperez -
Show More
@@ -4,7 +4,7 b''
4 4 All the matplotlib support code was co-developed with John Hunter,
5 5 matplotlib's author.
6 6
7 $Id: Shell.py 874 2005-09-20 20:13:04Z fperez $"""
7 $Id: Shell.py 882 2005-09-20 23:17:41Z fperez $"""
8 8
9 9 #*****************************************************************************
10 10 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
@@ -34,6 +34,9 b' from IPython.Struct import Struct'
34 34 from IPython.Magic import Magic
35 35 from IPython import ultraTB
36 36
37 # global flag to pass around information about Ctrl-C without exceptions
38 KBINT = False
39
37 40 # global flag to turn on/off Tk support.
38 41 USE_TK = False
39 42
@@ -241,8 +244,18 b' class IPShellEmbed:'
241 244 #-----------------------------------------------------------------------------
242 245 def sigint_handler (signum,stack_frame):
243 246 """Sigint handler for threaded apps.
244 """
245 raise KeyboardInterrupt
247
248 This is a horrible hack to pass information about SIGINT _without_ using
249 exceptions, since I haven't been able to properly manage cross-thread
250 exceptions in GTK/WX. In fact, I don't think it can be done (or at least
251 that's my understanding from a c.l.py thread where this was discussed)."""
252
253 global KBINT
254
255 print '\nKeyboardInterrupt - Press <Enter> to continue.',
256 Term.cout.flush()
257 # Set global flag so that runsource can know that Ctrl-C was hit
258 KBINT = True
246 259
247 260 class MTInteractiveShell(InteractiveShell):
248 261 """Simple multi-threaded shell."""
@@ -277,6 +290,13 b' class MTInteractiveShell(InteractiveShell):'
277 290
278 291 Modified version of code.py's runsource(), to handle threading issues.
279 292 See the original for full docstring details."""
293
294 global KBINT
295
296 # If Ctrl-C was typed, we reset the flag and return right away
297 if KBINT:
298 KBINT = False
299 return False
280 300
281 301 try:
282 302 code = self.compile(source, filename, symbol)
General Comments 0
You need to be logged in to leave comments. Login now