--- pkgutil.py 2012-07-24 10:17:19.816032662 +0530 +++ /root/pkgutil.py 2012-07-24 15:24:53.462032594 +0530 @@ -108,7 +108,9 @@ if ispkg: try: __import__(name) - except ImportError: + except (ImportError, RuntimeError, AttributeError): + #Catching the exceptions and using onerror just + #passing the module name. if onerror is not None: onerror(name) except Exception: