Repository: sympy/sympy

Issue:
Latex of ConditionSet gives 'FiniteSet' object has no attribute 'as_expr'
Solving
`sol = nonlinsolve([(sin(a*x)),cos(a*x)],[x,a])`
gives
`ConditionSet((x, a), {sin(a*x), cos(a*x)}, Complexes(Reals x Reals, False))`
calling
`latex(sol)`
outputs
`AttributeError: 'FiniteSet' object has no attribute 'as_expr'`
with both versions 1.3 and 1.4.dev

Discussion:

Patch:
diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py
index ccb42e9abb..173465c727 100644
--- a/sympy/printing/latex.py
+++ b/sympy/printing/latex.py
@@ -1879,7 +1879,7 @@ def _print_ConditionSet(self, s):
             vars_print,
             vars_print,
             self._print(s.base_set),
-            self._print(s.condition.as_expr()))
+            self._print(s.condition))
 
     def _print_ComplexRegion(self, s):
         vars_print = ', '.join([self._print(var) for var in s.variables])


Test patch:
diff --git a/sympy/printing/tests/test_latex.py b/sympy/printing/tests/test_latex.py
index 28d29ea061..f7abd32aa5 100644
--- a/sympy/printing/tests/test_latex.py
+++ b/sympy/printing/tests/test_latex.py
@@ -1883,6 +1883,13 @@ def test_latex_printer_tensor():
     assert latex(expr) == 'K{}^{i=3,j}{}_{kl}'
 
 
+def test_issue_15353():
+    from sympy import nonlinsolve, sin, cos, symbols
+    a, x = symbols('a x')
+    sol = nonlinsolve([(sin(a*x)),cos(a*x)],[x,a])
+    assert latex(sol) == r'\left\{\left( x, \  a\right) \mid \left( x, \  a\right) \in \mathbb{C} \wedge \left\{\sin{\left(a x \right)}, \cos{\left(a x \right)}\right\} \right\}'
+
+
 def test_trace():
     # Issue 15303
     from sympy import trace