File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed
Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 11import sys
22
33name = 'pylablib'
4-
5- if name in sys . modules :
4+ try :
5+ import pylablib
66 from .attocubeANC350 import AttocubeANC350
7- else :
7+ except ModuleNotFoundError :
88 from .attocube_exceptions import PylabLibMissingException as AttocubeANC350
Original file line number Diff line number Diff line change 22
33name = 'libHeLIC'
44
5- if name in sys .modules :
5+ try :
6+ import libHeLIC
67 from .helioscamera import HeliosCamera
7- else :
8+ except ModuleNotFoundError :
89 from .helios_exceptions import HeliosImportException as HeliosCamera
Original file line number Diff line number Diff line change 33# For illustrative purposes.
44name = 'seabreeze'
55
6- if name in sys .modules :
6+ try :
7+ import seabreeze
78 from .oceanopticsqepro import OceanOpticsQEPro
8- else :
9+ except ModuleNotFoundError :
910 from .oceanoptics_exceptions import SeabreezeMissingException as OceanOpticsQEPro
Original file line number Diff line number Diff line change 22import importlib .util
33import sys
44
5- name = 'thorlabs_kinesis'
6-
7-
8- if name in sys .modules :
5+ try :
6+ import pyscan_tlk
97 from .thorlabsbpc303 import ThorlabsBPC303
108 from .thorlabsbsc203 import ThorlabsBSC203
119 from .thorlabsmff101 import ThorlabsMFF101
12- else :
10+ except ModuleNotFoundError :
1311 from .thorlabs_exceptions import ThorlabsKinesisImportException as ThorlabsBPC303
1412 from .thorlabs_exceptions import ThorlabsKinesisImportException as ThorlabsBSC203
1513 from .thorlabs_exceptions import ThorlabsKinesisImportException as ThorlabsMFF101
You can’t perform that action at this time.
0 commit comments