# Buggy code
def _load_reporter(self):
    name = self._reporter_name.lower()
    if name in self._reporters:
        self.set_reporter(self._reporters[name]())
    else:
        qname = self._reporter_name
        module = modutils.load_module_from_name(modutils.get_module_part(qname))
        class_name = qname.split(".")[-1]
        reporter_class = getattr(module, class_name)
        self.set_reporter(reporter_class())


# Traceback (RuntimeError)
ubuntu@ip-0000:~/scripts/pooja/ext-code/pylint$ pip list | grep astroid
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
astroid (1.5.0)
ubuntu@ip-0000:~/scripts/pooja/ext-code/pylint$ pip list | grep pylint
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pylint (1.7.0, /usr/local/lib/python2.7/dist-packages/pylint-1.7.0-py2.7.egg)
ubuntu@ip-00000:~/scripts/pooja/ext-code/pylint$ cd /var/lib/jenkins/jobs/CI_SyntaxValidator_commons/workspace
(reverse-i-search)`inst': sudo python setup.py ^Cstall
ubuntu@ip-00000:/var/lib/jenkins/jobs/CI_SyntaxValidator_commons/workspace$ ^C
ubuntu@ip-0000:/var/lib/jenkins/jobs/CI_SyntaxValidator_commons/workspace$ pylint commons/
Traceback (most recent call last):
File "/usr/local/bin/pylint", line 11, in <module>
load_entry_point('pylint==1.7.0', 'console_scripts', 'pylint')()
File "/usr/local/lib/python2.7/dist-packages/pylint-1.7.0-py2.7.egg/pylint/__init__.py", line 13, in run_pylint
Run(sys.argv[1:])
File "/usr/local/lib/python2.7/dist-packages/pylint-1.7.0-py2.7.egg/pylint/lint.py", line 1220, in __init__
linter.load_default_plugins()
File "/usr/local/lib/python2.7/dist-packages/pylint-1.7.0-py2.7.egg/pylint/lint.py", line 453, in load_default_plugins
checkers.initialize(self)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.7.0-py2.7.egg/pylint/checkers/__init__.py", line 114, in initialize
register_plugins(linter, __path__[0])
File "/usr/local/lib/python2.7/dist-packages/pylint-1.7.0-py2.7.egg/pylint/utils.py", line 992, in register_plugins
module = modutils.load_module_from_file(join(directory, filename))
File "/usr/local/lib/python2.7/dist-packages/astroid-1.5.0-py2.7.egg/astroid/modutils.py", line 272, in load_module_from_file
return load_module_from_modpath(modpath, path, use_sys)
File "/usr/local/lib/python2.7/dist-packages/astroid-1.5.0-py2.7.egg/astroid/modutils.py", line 233, in load_module_from_modpath
module = imp.load_module(curname, mp_file, mp_filename, mp_desc)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.7.0-py2.7.egg/pylint/checkers/python3.py", line 100, in <module>
class Python3Checker(checkers.BaseChecker):
File "/usr/local/lib/python2.7/dist-packages/pylint-1.7.0-py2.7.egg/pylint/checkers/python3.py", line 501, in Python3Checker
'sys.version_info < (3, 0)',
File "/usr/local/lib/python2.7/dist-packages/astroid-1.5.0-py2.7.egg/astroid/node_classes.py", line 624, in repr_tree
_repr_tree(self, result, set())
File "build/bdist.linux-x86_64/egg/singledispatch.py", line 210, in wrapper
File "/usr/local/lib/python2.7/dist-packages/astroid-1.5.0-py2.7.egg/astroid/node_classes.py", line 613, in _repr_node
depth)
File "build/bdist.linux-x86_64/egg/singledispatch.py", line 210, in wrapper
File "/usr/local/lib/python2.7/dist-packages/astroid-1.5.0-py2.7.egg/astroid/node_classes.py", line 613, in _repr_node
depth)
File "build/bdist.linux-x86_64/egg/singledispatch.py", line 210, in wrapper
File "build/bdist.linux-x86_64/egg/singledispatch.py", line 191, in dispatch
File "build/bdist.linux-x86_64/egg/singledispatch.py", line 142, in _find_impl
File "build/bdist.linux-x86_64/egg/singledispatch.py", line 130, in _compose_mro
File "build/bdist.linux-x86_64/egg/singledispatch.py", line 84, in _c3_mro
File "build/bdist.linux-x86_64/egg/singledispatch.py", line 88, in _c3_mro
File "build/bdist.linux-x86_64/egg/singledispatch.py", line 39, in _c3_merge
RuntimeError: Inconsistent hierarchy

# Fixed code
def _load_reporter(self):
    name = self._reporter_name.lower()
    if name in self._reporters:
        self.set_reporter(self._reporters[name]())
    else:
        try:
            reporter_class = self._load_reporter_class()
        except (ImportError, AttributeError):
            raise exceptions.InvalidReporterError(name)
        else:
            self.set_reporter(reporter_class())