Repository: sympy/sympy

Issue:
Bug in nonlinsolve
`nonlinsolve([Eq(1, x + y), Eq(1, -x + y - 1), Eq(1, -x + y - 1)],x,y)` raises `AttributeError: 'BooleanTrue' object has no attribute 'is_constant'`

Discussion:

Patch:
diff --git a/sympy/solvers/solveset.py b/sympy/solvers/solveset.py
index 35f87e310e..63a545e14b 100644
--- a/sympy/solvers/solveset.py
+++ b/sympy/solvers/solveset.py
@@ -3119,7 +3119,7 @@ def _append_eq(eq, result, res, delete_soln, n=None):
         u = Dummy('u')
         if n:
             eq = eq.subs(n, 0)
-        satisfy = checksol(u, u, eq, minimal=True)
+        satisfy = eq if eq in (True, False) else checksol(u, u, eq, minimal=True)
         if satisfy is False:
             delete_soln = True
             res = {}


Test patch:
diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
index 68755df40e..603f13be72 100644
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -1581,6 +1581,8 @@ def test_nonlinsolve_basic():
     assert nonlinsolve([x**2 -1], sin(x)) == FiniteSet((S.EmptySet,))
     assert nonlinsolve([x**2 -1], 1) == FiniteSet((x**2,))
     assert nonlinsolve([x**2 -1], x + y) == FiniteSet((S.EmptySet,))
+    assert nonlinsolve([Eq(1, x + y), Eq(1, -x + y - 1), Eq(1, -x + y - 1)], x, y) == FiniteSet(
+        (-S.Half, 3*S.Half))
 
 
 def test_nonlinsolve_abs():