Skip to content

Commit e568652

Browse files
committed
fix-value-error
1 parent d4cd689 commit e568652

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

IPython/core/completer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,8 @@ def _trim_expr(self, code: str) -> str:
13521352
assert res is not None
13531353
if len(res.body) != 1:
13541354
continue
1355+
if not isinstance(res.body[0], ast.Expr):
1356+
continue
13551357
expr = res.body[0].value
13561358
if isinstance(expr, ast.Tuple) and not code[-1] == ")":
13571359
# we skip implicit tuple, like when trimming `fun(a,b`<completion>

0 commit comments

Comments
 (0)