We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e8ed5dd + e27bd21 commit f029e34Copy full SHA for f029e34
pyomo/common/dependencies.py
@@ -346,7 +346,10 @@ def __init__(
346
347
def __bool__(self):
348
self.resolve()
349
- return self._available
+ # resolve() guarantees that _available has been resolved to a bool
350
+ assert self._available.__class__ is bool
351
+ # The following cast is to keep static code analysis linters happy
352
+ return bool(self._available)
353
354
def resolve(self):
355
# Only attempt the import once, then cache some form of result
0 commit comments