Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions src/julia/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from IPython.utils import py3compat as compat
from traitlets import Bool, Enum

from .core import Julia, JuliaError
from .core import Julia
from .tools import redirect_output_streams

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -96,14 +96,7 @@ def julia(self, line, cell=None):
Python namespace.
"""
src = compat.unicode_type(line if cell is None else cell)

try:
ans = self._julia.eval(src)
except JuliaError as e:
print(e, file=sys.stderr)
ans = None

return ans
return self._julia.eval(src)


# Add to the global docstring the class information.
Expand Down
8 changes: 4 additions & 4 deletions test/test_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def test_success_cell(julia_magics):


def test_failure_line(julia_magics):
ans = julia_magics.julia('pop!([])')
assert ans is None
with pytest.raises(Exception):
julia_magics.julia("pop!([])")


def test_failure_cell(julia_magics):
ans = julia_magics.julia(None, '1 += 1')
assert ans is None
with pytest.raises(Exception):
julia_magics.julia(None, "1 += 1")


def test_revise_error():
Expand Down