summaryrefslogtreecommitdiff
path: root/numpy/f2py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/f2py')
-rw-r--r--numpy/f2py/symbolic.py2
-rw-r--r--numpy/f2py/tests/test_symbolic.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/numpy/f2py/symbolic.py b/numpy/f2py/symbolic.py
index 1b7b35458..c2ab0f140 100644
--- a/numpy/f2py/symbolic.py
+++ b/numpy/f2py/symbolic.py
@@ -381,7 +381,7 @@ class Expr:
language=language)
for a in self.data]
if language is Language.C:
- r = f'({cond} ? {expr1} : {expr2})'
+ r = f'({cond}?{expr1}:{expr2})'
elif language is Language.Python:
r = f'({expr1} if {cond} else {expr2})'
elif language is Language.Fortran:
diff --git a/numpy/f2py/tests/test_symbolic.py b/numpy/f2py/tests/test_symbolic.py
index e8dec72f0..845278311 100644
--- a/numpy/f2py/tests/test_symbolic.py
+++ b/numpy/f2py/tests/test_symbolic.py
@@ -201,7 +201,7 @@ class TestSymbolic(util.F2PyTest):
assert (x + (x - y) / (x + y) +
n).tostring(language=language) == "123 + x + (x - y) / (x + y)"
- assert as_ternary(x, y, z).tostring(language=language) == "(x ? y : z)"
+ assert as_ternary(x, y, z).tostring(language=language) == "(x?y:z)"
assert as_eq(x, y).tostring(language=language) == "x == y"
assert as_ne(x, y).tostring(language=language) == "x != y"
assert as_lt(x, y).tostring(language=language) == "x < y"