From c2d82d2bac8313a856ab67bcc14570d6a04e25c0 Mon Sep 17 00:00:00 2001 From: Hesky Fisher Date: Sat, 6 Jul 2013 18:42:27 -0400 Subject: [PATCH] Fix windows version of Treal to handle errors properly. --- plover/machine/treal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plover/machine/treal.py b/plover/machine/treal.py index 922a9a9ba..aaa8f6932 100644 --- a/plover/machine/treal.py +++ b/plover/machine/treal.py @@ -50,6 +50,7 @@ def update(self, p): class Stenotype(StenotypeBase): def __init__(self, params): StenotypeBase.__init__(self) + self._machine = None def start_capture(self): """Begin listening for output from the stenotype machine.""" @@ -70,7 +71,8 @@ def callback(p): def stop_capture(self): """Stop listening for output from the stenotype machine.""" - self._machine.close() + if self._machine: + self._machine.close() self._stopped() else: