##// END OF EJS Templates
Merging a bugfix branch....
Brian Granger -
r1935:088bbda9 merge
parent child Browse files
Show More
@@ -1675,7 +1675,7 b' Currently the magic system has the following functions:\\n"""'
1675 exit_ignore=exit_ignore)
1675 exit_ignore=exit_ignore)
1676 t1 = clock2()
1676 t1 = clock2()
1677 t_usr = t1[0]-t0[0]
1677 t_usr = t1[0]-t0[0]
1678 t_sys = t1[1]-t1[1]
1678 t_sys = t1[1]-t0[1]
1679 print "\nIPython CPU timings (estimated):"
1679 print "\nIPython CPU timings (estimated):"
1680 print " User : %10s s." % t_usr
1680 print " User : %10s s." % t_usr
1681 print " System: %10s s." % t_sys
1681 print " System: %10s s." % t_sys
@@ -1687,7 +1687,7 b' Currently the magic system has the following functions:\\n"""'
1687 exit_ignore=exit_ignore)
1687 exit_ignore=exit_ignore)
1688 t1 = clock2()
1688 t1 = clock2()
1689 t_usr = t1[0]-t0[0]
1689 t_usr = t1[0]-t0[0]
1690 t_sys = t1[1]-t1[1]
1690 t_sys = t1[1]-t0[1]
1691 print "\nIPython CPU timings (estimated):"
1691 print "\nIPython CPU timings (estimated):"
1692 print "Total runs performed:",nruns
1692 print "Total runs performed:",nruns
1693 print " Times : %10s %10s" % ('Total','Per run')
1693 print " Times : %10s %10s" % ('Total','Per run')
@@ -292,17 +292,19 b' if HAS_CTYPES:'
292 """raises the exception, performs cleanup if needed"""
292 """raises the exception, performs cleanup if needed"""
293 if not inspect.isclass(exctype):
293 if not inspect.isclass(exctype):
294 raise TypeError("Only types can be raised (not instances)")
294 raise TypeError("Only types can be raised (not instances)")
295 res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid,
295 # Explicit cast to c_long is necessary for 64-bit support:
296 # See https://bugs.launchpad.net/ipython/+bug/237073
297 res = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid),
296 ctypes.py_object(exctype))
298 ctypes.py_object(exctype))
297 if res == 0:
299 if res == 0:
298 raise ValueError("invalid thread id")
300 raise ValueError("invalid thread id")
299 elif res != 1:
301 elif res != 1:
300 # """if it returns a number greater than one, you're in trouble,
302 # If it returns a number greater than one, you're in trouble,
301 # and you should call it again with exc=NULL to revert the effect"""
303 # and you should call it again with exc=NULL to revert the effect
302 ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0)
304 ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0)
303 raise SystemError("PyThreadState_SetAsyncExc failed")
305 raise SystemError("PyThreadState_SetAsyncExc failed")
304
306
305 def sigint_handler (signum,stack_frame):
307 def sigint_handler(signum,stack_frame):
306 """Sigint handler for threaded apps.
308 """Sigint handler for threaded apps.
307
309
308 This is a horrible hack to pass information about SIGINT _without_
310 This is a horrible hack to pass information about SIGINT _without_
@@ -321,7 +323,7 b' if HAS_CTYPES:'
321 Term.cout.flush()
323 Term.cout.flush()
322
324
323 else:
325 else:
324 def sigint_handler (signum,stack_frame):
326 def sigint_handler(signum,stack_frame):
325 """Sigint handler for threaded apps.
327 """Sigint handler for threaded apps.
326
328
327 This is a horrible hack to pass information about SIGINT _without_
329 This is a horrible hack to pass information about SIGINT _without_
@@ -248,7 +248,7 b' class BackgroundJobManager:'
248 self._update_status()
248 self._update_status()
249 new_comp = self._group_report(self._comp_report,'Completed')
249 new_comp = self._group_report(self._comp_report,'Completed')
250 new_dead = self._group_report(self._dead_report,
250 new_dead = self._group_report(self._dead_report,
251 'Dead, call job.traceback() for details')
251 'Dead, call jobs.traceback() for details')
252 self._comp_report[:] = []
252 self._comp_report[:] = []
253 self._dead_report[:] = []
253 self._dead_report[:] = []
254 return new_comp or new_dead
254 return new_comp or new_dead
@@ -340,7 +340,7 b' class BackgroundJobBase(threading.Thread):'
340 stat_created = 'Created'; stat_created_c = 0
340 stat_created = 'Created'; stat_created_c = 0
341 stat_running = 'Running'; stat_running_c = 1
341 stat_running = 'Running'; stat_running_c = 1
342 stat_completed = 'Completed'; stat_completed_c = 2
342 stat_completed = 'Completed'; stat_completed_c = 2
343 stat_dead = 'Dead (Exception), call job.traceback() for details'
343 stat_dead = 'Dead (Exception), call jobs.traceback() for details'
344 stat_dead_c = -1
344 stat_dead_c = -1
345
345
346 def __init__(self):
346 def __init__(self):
@@ -391,7 +391,7 b' class BackgroundJobBase(threading.Thread):'
391 self.status = BackgroundJobBase.stat_dead
391 self.status = BackgroundJobBase.stat_dead
392 self.stat_code = BackgroundJobBase.stat_dead_c
392 self.stat_code = BackgroundJobBase.stat_dead_c
393 self.finished = None
393 self.finished = None
394 self.result = ('<BackgroundJob died, call job.traceback() for details>')
394 self.result = ('<BackgroundJob died, call jobs.traceback() for details>')
395 self._tb = self._make_tb()
395 self._tb = self._make_tb()
396 else:
396 else:
397 self.status = BackgroundJobBase.stat_completed
397 self.status = BackgroundJobBase.stat_completed
General Comments 0
You need to be logged in to leave comments. Login now