sapling/hgdemandimport
Yuya Nishihara 0d4ca251b9 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.
2017-07-16 17:38:39 +09:00
..
__init__.py demandimport: add python 3 implementation 2017-05-21 12:23:04 -07:00
demandimportpy2.py demandimport: prefer loaded module over package attribute (issue5617) 2017-07-16 17:38:39 +09:00
demandimportpy3.py demandimport: add python 3 implementation 2017-05-21 12:23:04 -07:00