Pavel Aslanov added the comment:
This function is broken again in version 3.4
The way it should look is:
Python 2.7.6 (default, Feb 26 2014, 12:07:17)
[GCC 4.8.2 20140206 (prerelease)] on linux2
Type help, copyright, credits or license for more information.
import pkgutil
pkgutil.get_loader
New submission from Pavel Aslanov asl.pa...@gmail.com:
if module was marked as not existing by setting sys.modules [fullname] to None,
then pkgutil.get_loader (fullname) will throw AttributeError.
Example:
#! /usr/bin/evn python
import unittest
import pkgutil
def main
Pavel Aslanov asl.pa...@gmail.com added the comment:
Main use case of pkgutil.get_loader is to determine if its possible to load
module and either return loader or None. But it throws exception more over it
is AttributeErrror exception