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

How to exit gracefully Matlab on exception (SIGINT) #235

Open
fbrundu opened this issue Apr 22, 2016 · 0 comments
Open

How to exit gracefully Matlab on exception (SIGINT) #235

fbrundu opened this issue Apr 22, 2016 · 0 comments

Comments

@fbrundu
Copy link

fbrundu commented Apr 22, 2016

I am writing a script that run Matlab from pymatbridge. When I stop the script with SIGINT (Ctrl-C), the Matlab instance fails to close. How can I close it?
This is my code:

class Schedule(object):
    exposed = True

    def __init__(self):
        # FIXME
        self.mlab_path = "/Applications/MATLAB_R2015a.app/bin/matlab"
        self.mlab = Matlab(executable=self.mlab_path)
        self.mlab.start()

    def __enter__(self):
        pass

    def __exit__(self, exc_type, exc_value, traceback):
        self.mlab.stop()

@fbrundu fbrundu closed this as completed Apr 23, 2016
@fbrundu fbrundu reopened this Apr 23, 2016
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

1 participant