lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.51k stars 164 forks source link

`TypeError` does not print the message #2666

Open Shaikh-Ubaid opened 6 months ago

Shaikh-Ubaid commented 6 months ago
% cat examples/expr2.py                           
raise TypeError("Some error")
% python examples/expr2.py
Traceback (most recent call last):
  File "/Users/ubaid/Desktop/OpenSource/lpython/examples/expr2.py", line 1, in <module>
    raise TypeError("Some error")
TypeError: Some error
% lpython examples/expr2.py
ERROR STOP

ASR::ErrorStop has an argument to print the message, so we should put the message during AST->ASR in that appropriate argument.

kmr-srbh commented 6 months ago

@Shaikh-Ubaid this bug exists for all the builtin exceptions like ValueError, ZeroDivisionError, etc.