Skip to content

Commit ee281ae

Browse files
authored
fix(keysite driver): Added new exception for keysite SD1 loading, rem… (#244)
* fix(keysite driver): Added new exception for keysite SD1 loading, removed error message * syntax(): fixed flake8 error
1 parent b32024a commit ee281ae

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

pyscan/drivers/keysight/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import os
22

3-
if os.path.exists(r'c:\Program Files (x86)\Keysight\SD1\Libraries\Python'):
4-
from .keysightm3302adaq import KeysightM3302ADAQ
5-
from .keysightm3302aawg import KeysightM3302AAWG
6-
else:
3+
4+
try:
5+
if os.path.exists(r'c:\Program Files (x86)\Keysight\SD1\Libraries\Python'):
6+
from .keysightm3302adaq import KeysightM3302ADAQ
7+
from .keysightm3302aawg import KeysightM3302AAWG
8+
else:
9+
from .keysite_exceptions import KeysightSD1Error as KeysightM3302ADAQ
10+
from .keysite_exceptions import KeysightSD1Error as KeysightM3302AAWG
11+
except FileNotFoundError:
712
from .keysite_exceptions import KeysightSD1Error as KeysightM3302ADAQ
813
from .keysite_exceptions import KeysightSD1Error as KeysightM3302AAWG
914

pyscan/drivers/keysight/keysightm3302adaq.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
try:
88
import keysightSD1
99
except:
10-
print('Could not load Keysight SD1')
10+
# print('Could not load Keysight SD1')
11+
pass
1112

1213

1314
class KeysightM3302ADAQ(ItemAttribute):

0 commit comments

Comments
 (0)