Skip to content

Commit f7d0058

Browse files
committed
fix crash when SymPy or mpmath not installed
1 parent ae8ceee commit f7d0058

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

unpythonic/mathseq.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
try:
4848
from mpmath import mpf, almosteq as mpf_almosteq
4949
except ImportError:
50-
mpf = mpf_almosteq = None
50+
mpf = type(None)
51+
mpf_almosteq = None
5152

5253
def _numsign(x):
5354
if x == 0:
@@ -68,6 +69,7 @@ def sign(x):
6869
except ImportError:
6970
log = math_log
7071
sign = _numsign
72+
_symExpr = type(None)
7173

7274
def almosteq(a, b, tol=1e-8):
7375
"""Almost-equality that supports several formats.

0 commit comments

Comments
 (0)