[zope2-tracker] [Bug 659968] Re: guarded_import does not support 5-args form

Vincent Pelletier 659968 at bugs.launchpad.net
Fri Oct 15 10:09:16 EDT 2010


Thanks.

Do you really want to use 0 here ? From python documentation[1], default
level is -1.

I did a few tests to see how level affects __import__ behaviour, see
attached tarball for the source, and below is the output I get here:

$ python2.5 test.py
absolute keyword: success urllib2 some_module.urllib2
relative keyword: success
relative built-in failed
absolute built-in, level -1 : success urllib2 some_module.urllib2
absolute built-in, level 0 : success urllib2
absolute built-in, level 1 : success urllib2 some_module.urllib2
absolute built-in, level 2 : failed

[1] http://docs.python.org/release/2.5/lib/built-in-funcs.html

Regards,
Vincent Pelletier

** Attachment added: "import_test.tgz"
   https://bugs.launchpad.net/zope2/+bug/659968/+attachment/1694664/+files/import_test.tgz

-- 
guarded_import does not support 5-args form
https://bugs.launchpad.net/bugs/659968
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.


More information about the zope2-tracker mailing list