Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tweedledum runtime detection in BooleanExpression.from_dimacs_file (
#10132) (#10137) This commit fixes an oversight in the 0.24.0 release that caused an accidental change in the exception raised when attempting to use BooleanExpression.from_dimacs_file without having tweedledum installed. In #9754 the detection of tweedledum was updated to avoid import time detection so that the module can be imported even if tweedledum isn't installed. This was done through the use of the optionals decorators so that tweedledum is only attempted to be imported when the classicalfunction modules is used. However, the decorators don't wrap classmethod constructors by default and this caused the incorrect exception type to be raised. This commit fixes this by doing the runtime checking manually inside the from_dimacs_file constructor. (cherry picked from commit 9f647c7) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
- Loading branch information