##// END OF EJS Templates
demandimport: prefer loaded module over package attribute (issue5617)...
demandimport: prefer loaded module over package attribute (issue5617) In general, the attribute of the same name is overwritten by executing an import statement. import a.b print(a.b.c) # 'c' of a/b/__init__.py from a.b.c import d print(a.b.c) # a/b/c.py However, this appears not true for the scenario described in the test case, and surprisingly, "from a.b.c import d" works even if "a.b.c" is not a module. This patch works around the problem by taking the right module from sys.modules if available.
Yuya Nishihara -
r33531:9cbbf911 default
Show More
Name Size Modified Last Commit Author
/ hgdemandimport
__init__.py Loading ...
demandimportpy2.py Loading ...
demandimportpy3.py Loading ...