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

Import failures prevent from re-trying #1523

Closed
etanol opened this issue Mar 6, 2018 · 6 comments
Closed

Import failures prevent from re-trying #1523

etanol opened this issue Mar 6, 2018 · 6 comments
Labels

Comments

@etanol
Copy link
Contributor

etanol commented Mar 6, 2018

During development, it is common to import faulty modules from the repl. If a Hy module fails to load due to a HyTypeError or LexException, it cannot be loaded again until the repl is restarted.

There is a different exception treatment in the importer. One of the exception blocks is not cleaning up sys.modules before returning and that leaves a trace of the failure.

@etanol
Copy link
Contributor Author

etanol commented Mar 6, 2018

The root cause of this is somehow also related to the root cause of #1134. However, the fix is different.

@vodik
Copy link
Contributor

vodik commented Mar 6, 2018

If you're interested, dig into #1514 and #1518. I started digging into this a few weeks ago and there's a lot of problems with the loader.

@gilch
Copy link
Member

gilch commented Mar 21, 2018

Probably related to #712.

As I mentioned in #1514, "I think the corrupted module object remains in the module cache. We're supposed to remove it if it doesn't load."

@etanol
Copy link
Contributor Author

etanol commented Mar 21, 2018

I think efforts should go into completing #1518. Hy's importer is not even compliant with PEP-0302, therefore it's a matter of implementing it right in order to match the expectations of the average Python user.

@gilch gilch added the bug label Mar 23, 2018
brandonwillard added a commit to brandonwillard/hy that referenced this issue Aug 21, 2018
@brandonwillard
Copy link
Member

This should be closed by #1672 (and/or after #1683 for Python 2.7).

@etanol
Copy link
Contributor Author

etanol commented Oct 7, 2018

Definitely.

@etanol etanol closed this as completed Oct 7, 2018
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.

4 participants