{"action":"reopened","issue":{"url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/235","repository_url":"https://api.github.com/repos/arokem/python-matlab-bridge","labels_url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/235/comments","events_url":"https://api.github.com/repos/arokem/python-matlab-bridge/issues/235/events","html_url":"https://github.com/arokem/python-matlab-bridge/issues/235","id":150337754,"number":235,"title":"How to exit gracefully Matlab on exception (SIGINT)","user":{"login":"fbrundu","id":697622,"avatar_url":"https://avatars.githubusercontent.com/u/697622?v=3","gravatar_id":"","url":"https://api.github.com/users/fbrundu","html_url":"https://github.com/fbrundu","followers_url":"https://api.github.com/users/fbrundu/followers","following_url":"https://api.github.com/users/fbrundu/following{/other_user}","gists_url":"https://api.github.com/users/fbrundu/gists{/gist_id}","starred_url":"https://api.github.com/users/fbrundu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbrundu/subscriptions","organizations_url":"https://api.github.com/users/fbrundu/orgs","repos_url":"https://api.github.com/users/fbrundu/repos","events_url":"https://api.github.com/users/fbrundu/events{/privacy}","received_events_url":"https://api.github.com/users/fbrundu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-22T10:54:40Z","updated_at":"2016-04-23T10:20:56Z","closed_at":null,"body":"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?\r\nThis is my code:\r\n\r\n```\r\nclass Schedule(object):\r\n    exposed = True\r\n\r\n    def __init__(self):\r\n        # FIXME\r\n        self.mlab_path = \"/Applications/MATLAB_R2015a.app/bin/matlab\"\r\n        self.mlab = Matlab(executable=self.mlab_path)\r\n        self.mlab.start()\r\n\r\n    def __enter__(self):\r\n        pass\r\n\r\n    def __exit__(self, exc_type, exc_value, traceback):\r\n        self.mlab.stop()\r\n\r\n```"}}