Fix for running 'python -m' when using swig -builtin
Same as e05b5ea for -builtin.
Also added runtime tests to check 'python -m'.
This commit is contained in:
parent
9e83d5d5d9
commit
604ae7186b
17 changed files with 155 additions and 9 deletions
|
|
@ -734,7 +734,7 @@ public:
|
|||
*
|
||||
*/
|
||||
Printf(default_import_code, "\n# Pull in all the attributes from %s\n", module);
|
||||
Printv(default_import_code, "if __name__.rpartition('.')[0] != '':\n", NULL);
|
||||
Printv(default_import_code, "if __package__ or __name__.rpartition('.')[0]:\n", NULL);
|
||||
Printv(default_import_code, tab4, "try:\n", NULL);
|
||||
Printf(default_import_code, tab4 tab4 "from .%s import *\n", module);
|
||||
Printv(default_import_code, tab4 "except ImportError:\n", NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue