asteval
asteval copied to clipboard
Duplicated NameError in 1.0.2?
In a project using asteval, a test that creates a NameError started failing with a doubled error count when I upgraded to 1.0.2. I see this addressed a problem with NameError handling, but:
In [1]: import asteval
In [2]: interpreter = asteval.Interpreter(nested_symtable=False, use_numpy=False)
In [3]: interpreter.run("print(hi)", with_raise=False)
In [4]: print([e.get_error() for e in interpreter.error])
[('NameError', " print(hi)\n ^^^^\nNameError: name 'hi' is not defined"), ('NameError', " print(hi)\n ^^^^\nNameError: name 'hi' is not defined")]
For comparison, after downgrading to 1.0.1:
In [1]: import asteval
In [2]: interpreter = asteval.Interpreter(nested_symtable=False, use_numpy=False)
In [3]: interpreter.run("print(hi)", with_raise=False)
In [4]: print([e.get_error() for e in interpreter.error])
[('NameError', " print(hi)\n ^^^\nname 'hi' is not defined")]