Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove internal importlib frames from traceback #1693

Closed
brandonwillard opened this issue Nov 8, 2018 · 1 comment · Fixed by #2129
Closed

Remove internal importlib frames from traceback #1693

brandonwillard opened this issue Nov 8, 2018 · 1 comment · Fixed by #2129
Labels

Comments

@brandonwillard
Copy link
Member

Python 3.x uses _call_with_frames_removed to remove internal frames from tracebacks. I tried it in #1687, but couldn't get it to work; might be due to this Python issue.
Regardless, it would be good to remove those frames somehow.

@allison-casey
Copy link
Contributor

as an example:

>>> import a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/alliejo/dev/langs/hy/a.py", line 1
    print('hi"
              ^
SyntaxError: EOL while scanning string literal
=> (import a)
Traceback (most recent call last):
  File "stdin-99c0d4eb813cb56c622500ab4696f5bbb3cb3660", line 1, in <module>
    (import a)
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 786, in exec_module
  File "<frozen importlib._bootstrap_external>", line 923, in get_code
  File "/home/alliejo/dev/langs/hy/a.hy", line 1
    (print 'hi"
              ^
hy.lex.exceptions.PrematureEndOfInput: Partial string literal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants