Skip to content

Commit 88da729

Browse files
committed
cache status of slycot in slycot_check()
1 parent 91a0455 commit 88da729

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

control/exception.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@ class ControlNotImplemented(NotImplementedError):
6161
pass
6262

6363
# Utility function to see if slycot is installed
64+
slycot_installed = None
6465
def slycot_check():
65-
try:
66-
import slycot
67-
except:
68-
return False
69-
else:
70-
return True
66+
global slycot_installed
67+
if slycot_installed is None:
68+
try:
69+
import slycot
70+
slycot_installed = True
71+
except:
72+
slycot_installed = False
73+
return slycot_installed

0 commit comments

Comments
 (0)