Issue 1525766: pkgutil.walk_packages ignores onerror arg (original) (raw)

pkgutil.walk_packages doesn't properly pass the onerror argument to recursive calls.

Also, the docstrings are quite lacking.

Finally, it doesn't pass the name of the thing it was trying to import to the onerror handler, making using the handler for error reporting a bit difficult.

This patch fixes all three of those. If the change to the onerror handler signature is controversial, I can make another patch without that at least the clearly bugfix part of this can go in py2.5.