Ticket #714: 6405.patch

File 6405.patch, 1.9 KB (added by malb, 13 years ago)
  • sage/interfaces/expect.py

    # HG changeset patch
    # User Martin Albrecht <malb@informatik.uni-bremen.de>
    # Date 1190314615 -3600
    # Node ID 47600fec5fb78ba34687523572c08f4d4a758e8f
    # Parent  d7ff07b465f95da139a17b2907f2692c365170c1
    raise exception if a subprocess could not be killed
    
    diff -r d7ff07b465f9 -r 47600fec5fb7 sage/interfaces/expect.py
    a b If this all works, you can then make cal 
    598598        if self._restart_on_ctrlc:
    599599            try:
    600600                self._expect.close(force=1)
    601             except pexpect.ExceptionPexpect:
    602                 print "WARNING: -- unable to kill %s. You may have to do so manually."%self
    603                 pass
     601            except pexpect.ExceptionPexpect, msg:
     602                raise pexcept.ExceptionPexpect( "THIS IS A BUG -- PLEASE REPORT. This should never happen.\n" + msg)
    604603            self._start()
    605604            raise KeyboardInterrupt, "Restarting %s (WARNING: all variables defined in previous session are now invalid)"%self
    606605        else:
  • sage/interfaces/singular.py

    diff -r d7ff07b465f9 -r 47600fec5fb7 sage/interfaces/singular.py
    a b class Singular(Expect): 
    744744        print "Interrupting %s..."%self
    745745        try:
    746746            self._expect.sendline(chr(4))
    747         except pexpect.ExceptionPexpect:
    748             print "WARNING: -- unable to kill %s. You may have to do so manually."%self
    749             pass
     747        except pexpect.ExceptionPexpect, msg:
     748            raise pexcept.ExceptionPexpect("THIS IS A BUG -- PLEASE REPORT. This should never happen.\n" + msg)
    750749        self._start()
    751750        raise KeyboardInterrupt, "Restarting %s (WARNING: all variables defined in previous session are now invalid)"%self
    752751