Skip to content

Commit 4f4817b

Browse files
committed
Fix funny error
1 parent 4e21146 commit 4f4817b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pyscipopt/scip.pxi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,8 @@ cdef class Solution:
10001000
"""Base class holding a pointer to corresponding SCIP_SOL."""
10011001

10021002
# We are raising an error here to avoid creating a solution without an associated model. See Issue #625
1003-
def __init__(self, raise_error = False):
1004-
if not raise_error:
1003+
def __init__(self, raise_error = True):
1004+
if raise_error:
10051005
raise ValueError("To create a solution you should use the createSol method of the Model class.")
10061006

10071007
@staticmethod
@@ -1025,7 +1025,7 @@ cdef class Solution:
10251025
"""
10261026
if scip == NULL:
10271027
raise Warning("cannot create Solution with SCIP* == NULL")
1028-
sol = Solution(True)
1028+
sol = Solution(raise_error=False)
10291029
sol.sol = scip_sol
10301030
sol.scip = scip
10311031
return sol

0 commit comments

Comments
 (0)