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 caught and ignored, while all other
    exceptions are propagated, terminating the search.
"""

My expectation of this is that if onerrors is left as None, names yielded will be importable.

However, because the yield is before the import check, you can get packages returned that are not importable.

This feels at odds with the docs above and I think is a bug.

If the yield were dropped to befoer the import check, we wouldn't have this problem.

what do others think?

cheers,

Chris

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to