Skip to content

Commit

Permalink
xonsh: fix empty callback result
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Nov 18, 2020
1 parent 6c6fd64 commit 0e28e55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions example/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,11 @@ def _example_completer(prefix, line, begidx, endidx, ctx):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()
cb = cb.decode('utf-8')
nonlocal prefix, line, begidx, endidx, ctx
return eval(cb)
if cb == "":
return {}
else:
nonlocal prefix, line, begidx, endidx, ctx
return eval(cb)
if False:
pass
Expand Down
7 changes: 5 additions & 2 deletions xonsh/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ def _%v_completer(prefix, line, begidx, endidx, ctx):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()
cb = cb.decode('utf-8')
nonlocal prefix, line, begidx, endidx, ctx
return eval(cb)
if cb == "":
return {}
else:
nonlocal prefix, line, begidx, endidx, ctx
return eval(cb)
if False:
pass%s
Expand Down

0 comments on commit 0e28e55

Please sign in to comment.