[riot-notifications] [RIOT-OS/RIOT] riotnode: node abstraction package (#10949)

Martine Lenders notifications at github.com
Sun Apr 14 17:48:53 CEST 2019


miri64 commented on this pull request.



> +    def _safe_term_close(self):
+        """Safe 'term.close'.
+
+        Handles possible exceptions.
+        """
+        try:
+            self.term.close()
+        except AttributeError:
+            # Not initialized
+            pass
+        except ProcessLookupError:
+            self.logger.warning('Process already stopped')
+        except pexpect.ExceptionPexpect:
+            # Not sure how to cover this in a test
+            # 'make term' is not killed by 'term.close()'
+            self.logger.critical('Could not close make term')

How about

```suggestion
            self.logger.critical('Could not close make term')
        finally:
            self.term = None
```

? Thes way one can check (e.g. in a subclass) if the terminal is running or not.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10949#pullrequestreview-226401368
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190414/331fb882/attachment.html>


More information about the notifications mailing list