Re: bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-30 Thread Peter Otten
Chris Withers wrote: > Peter Otten wrote: >>> My expectation of this is that if onerrors is left as None, names >>> yielded will be importable. >> >> I would infer no such promise, especially as the generator also yields >> modules, and no attempt at all is made to import those. > > Really? Ye

Re: bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-30 Thread Chris Withers
Peter Otten wrote: My expectation of this is that if onerrors is left as None, names yielded will be importable. I would infer no such promise, especially as the generator also yields modules, and no attempt at all is made to import those. Really? I thought the __import__ fired over everythi

Re: bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-26 Thread Peter Otten
Chris Withers wrote: > From the docs of pkgutils.walk_packages: > """ > 'onerror' is a function which gets called with one argument (the > name of the package which was being imported) if any exception > occurs while trying to import a package. If no onerror function is > sup

bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-26 Thread Chris Withers
Hi All, From the docs of pkgutils.walk_packages: """ 'onerror' is a function which gets called with one argument (the name of the package which was being imported) if any exception occurs while trying to import a package. If no onerror function is supplied, ImportErrors are caugh