Closed alanjds closed 6 years ago
Can I merge this?
My main concern is about the a test that I could not understand how to change to the new behaviors. Then I got it disabled.
I don't fully understand whats happening...
The transpiler originally raised util.ImportError
on compile time, but this was wrong. Ideally, every import should allow_error=True
and return an empty Import object, letting a __builtin__.ImportError
to raise on run time and maybe be handled by a try..except.
However, internally the transpiler goes falling back several times in case of util.ImportError occurrences. From this came the need of only the last cases to allow_error=True
.
And it (transpiler) originally had no support for import *
or from ?? import *
, and this two are different cases internally.
I should start to fill the docstrings of internal APIs, or even writing another article to explain it. It is becoming a series :|
This fixes some ImportError issues when importing * from a broken/absent module, as:
I could not find a clean way to write the test, as
imputil_test.py
structure had not "clicked" on my mind yet. Help on this test would be appreciated.