fix the relative import patch by try both relative and absolute import
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10625 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
31926ad905
commit
1f2c29342f
1 changed files with 4 additions and 1 deletions
|
|
@ -701,7 +701,10 @@ public:
|
|||
* code conditional on the python version.
|
||||
*/
|
||||
Printv(f_shadow, "if version_info >= (2,6,0):\n", NULL);
|
||||
Printf(f_shadow, tab4 "from . import %s\n", module);
|
||||
Printv(f_shadow, tab4, "try:\n", NULL);
|
||||
Printf(f_shadow, tab8 "from . import %s\n", module);
|
||||
Printv(f_shadow, tab4, "except ValueError:\n");
|
||||
Printf(f_shadow, tab8 "import %s\n", module);
|
||||
Printv(f_shadow, "else:\n", NULL);
|
||||
Printf(f_shadow, tab4 "import %s\n", module);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue