use relative import for -builtin and python2
This commit is contained in:
parent
ca63491d7a
commit
10d71ca01a
1 changed files with 2 additions and 1 deletions
|
|
@ -868,7 +868,8 @@ public:
|
||||||
* will only work for non-package modules.
|
* will only work for non-package modules.
|
||||||
*/
|
*/
|
||||||
Printv(f_shadow, "if __name__.rpartition('.')[0] != '':\n", NULL);
|
Printv(f_shadow, "if __name__.rpartition('.')[0] != '':\n", NULL);
|
||||||
Printf(f_shadow, tab4 "from .%s import *\n", module);
|
Printf(f_shadow, tab4 "from %s%s import *\n", (py3 ? "." : ""),
|
||||||
|
module);
|
||||||
Printv(f_shadow, "else:\n", NULL);
|
Printv(f_shadow, "else:\n", NULL);
|
||||||
Printf(f_shadow, tab4 "from %s import *\n", module);
|
Printf(f_shadow, tab4 "from %s import *\n", module);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue