Skip to content

Commit c9cdad8

Browse files
committed
Colorize errors
1 parent 21108f3 commit c9cdad8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pysrc/juliacall/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ def __str__(self):
3636
e = self.exception
3737
b = self.backtrace
3838
if b is None:
39-
return Base.sprint(Base.showerror, e)
39+
f = Main.seval("e -> io -> showerror(IOContext(io, :color=>true), e)")(e)
4040
else:
41-
return Base.sprint(Base.showerror, e, b)
41+
f = Main.seval("(e, b) -> io -> showerror(IOContext(io, :color=>true), e, b)")(e, b)
42+
return Base.sprint(f)
4243
@property
4344
def exception(self):
4445
return self.args[0]

0 commit comments

Comments
 (0)