File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 2626import microscope .abc
2727
2828
29+ # Both pySerial and serial distribution packages install an import
30+ # package named serial. If both are installed we may have imported
31+ # the wrong one. Check it to provide a better error message. See
32+ # issue #232.
33+ if not hasattr (serial , "Serial" ):
34+ if hasattr (serial , "marshall" ):
35+ raise microscope .MicroscopeError (
36+ "incorrect imported package serial. It appears that the serial"
37+ " package from the distribution serial, instead of pyserial, was"
38+ " imported. Consider uninstalling serial and installing pySerial."
39+ )
40+ else :
41+ raise microscope .MicroscopeError (
42+ "imported package serial does not have Serial class"
43+ )
44+
45+
2946class OnlyTriggersOnceOnSoftwareMixin (microscope .abc .TriggerTargetMixin ):
3047 """Utility mixin for devices that only trigger "once" with software.
3148
You can’t perform that action at this time.
0 commit comments