From cc3f7f19df459027bc81d0812e00706c21d25352 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Tue, 19 Feb 2019 13:42:17 +0000 Subject: [PATCH] Fixed attaching lock failure --- openflexure_microscope/microscope.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openflexure_microscope/microscope.py b/openflexure_microscope/microscope.py index 5f01a51b..b2984b72 100644 --- a/openflexure_microscope/microscope.py +++ b/openflexure_microscope/microscope.py @@ -41,6 +41,9 @@ class Microscope(object): else: self.rc = OpenflexureConfig(expand=True) # Load config from default path + # Initialise with an empty composite lock + self.lock = CompositeLock([]) #: :py:class:`openflexure_microscope.lock.CompositeLock`: Composite lock controlling thread access to multiple pieces of hardware + # Attach initial hardware (may be NoneTypes) self.camera = None self.stage = None @@ -63,9 +66,7 @@ class Microscope(object): if 'fov' not in self.rc.config: self.rc.write({'fov': [0, 0]}) - # Initialise with an empty composite lock - self.lock = CompositeLock([]) #: :py:class:`openflexure_microscope.lock.CompositeLock`: Composite lock controlling thread access to multiple pieces of hardware - + def __enter__(self): """Create microscope on context enter.""" return self