Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtests.py could detect if the interpreter process crashes #40

Closed
tbu- opened this issue Mar 13, 2015 · 4 comments
Closed

runtests.py could detect if the interpreter process crashes #40

tbu- opened this issue Mar 13, 2015 · 4 comments

Comments

@tbu-
Copy link

tbu- commented Mar 13, 2015

Would be faster than waiting for timeouts.

@boxed
Copy link

boxed commented Mar 15, 2015

I've implemented a small change for my own code that makes a big difference: wrap the contents of read_to_prompt in:

try:
    ....
except KeyboardError:
    print 'Cancelled. Input so far:'
    print ''
    print self.buf
    exit(1)

And then change cleanup() to:

    def cleanup(self):
        #print "cleaning up"
        if self.p:
            try:
                os.killpg(self.p.pid, signal.SIGTERM)
            except OSError:
                pass
            self.p = None

Then you can ctrl+c out of something and see what happened. This is a HUGE improvement over the current usability, for a very trivial code change.

@kanaka
Copy link
Owner

kanaka commented Mar 15, 2015

@boxed that's a good improvement for sure. I pushed a slight variation on that. Thanks.

kanaka added a commit that referenced this issue Mar 19, 2015
Fixes: #40

- Simplify exception handling by combining keyboard exception into
  other exception handler. Print out output buffer on all exceptions.
@kanaka
Copy link
Owner

kanaka commented Mar 19, 2015

Just pushed a fix that should resolve this. @tbu- can you confirm that it works for you?

@kanaka kanaka closed this as completed Mar 19, 2015
@tbu-
Copy link
Author

tbu- commented Mar 20, 2015

Works for me, immediately errors out. Thanks for the fix.

micfan pushed a commit to micfan/make-a-lisp that referenced this issue Nov 8, 2018
micfan pushed a commit to micfan/make-a-lisp that referenced this issue Nov 8, 2018
Fixes: kanaka#40

- Simplify exception handling by combining keyboard exception into
  other exception handler. Print out output buffer on all exceptions.
luelista pushed a commit to luelista/mal that referenced this issue Mar 10, 2024
Fixes: kanaka#40

- Simplify exception handling by combining keyboard exception into
  other exception handler. Print out output buffer on all exceptions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants