Skip to content

Commit

Permalink
Proper handling of empty code cells.
Browse files Browse the repository at this point in the history
  • Loading branch information
abingham committed Apr 22, 2017
1 parent d2985d3 commit ede7c0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elm_kernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def _compile(self, code):
@property
def _should_compile(self):
assert self._code, "Should not be querying for compilation with no code!"
last_line = deque(io.StringIO(self._code[-1]), 1)[0]
return last_line == '-- compile-code'
lines = deque(io.StringIO(self._code[-1]), 1)
return lines[0] == '-- compile-code' if lines else False

def _send_error_result(self, msg):
"""Send an error message to the client.
Expand Down

0 comments on commit ede7c0b

Please sign in to comment.