X Tutup
Skip to content

Commit 5617a43

Browse files
committed
Use isinstance for type checking
1 parent d10e335 commit 5617a43

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bpython/simpleeval.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def _convert(node):
139139
left = _convert(node.left)
140140
right = _convert(node.right)
141141
if not (
142-
type(left) in _numeric_types and type(right) in _numeric_types
142+
isinstance(left, _numeric_types)
143+
and isinstance(right, _numeric_types)
143144
):
144145
raise ValueError("binary + and - only allowed on builtin nums")
145146
if isinstance(node.op, ast.Add):

0 commit comments

Comments
 (0)
X Tutup