erg-lang / erg

A statically typed language compatible with Python
http://erg-lang.org
Apache License 2.0
2.7k stars 55 forks source link

REPL: unexpected exception is thrown #419

Closed Hanaasagi closed 1 year ago

Hanaasagi commented 1 year ago

Describe the bug?

Enter the REPL, and type assert 1 == 2

>>> assert 1 == 2
Traceback (most recent call last):
  File "<string>", line 32, in <module>
  File "<string>", line 1, in <module>
  File "<stdin>", line -1, in <module>
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 36, in <module>
NameError: name 'e' is not defined

A NameError: name 'e' is not defined is thrown, this is not expected. And REPL is not worked after this exception. E.g. type print!("hello"), no text is displayed.

Reproducible code

assert 1 == 2

Expected result

No NameError here.

Actual result

2023-04-22_13-00

Additional context

No response

Erg version

main branch, commit hash is fb294fa991beebdb2a4445173ac4d77470e2c677

Python version

Python3.10

OS

Linux (other distro)

anzhi0708 commented 1 year ago

I had the same problem