Traceback (most recent call last):


 "uvloop/cbhandles.pyx", line 64, in uvloop.loop.Handle._run


 "/usr/src/app/homeassistant/helpers/event.py", line 82, in state_change_listener

event.data.get('new_state'))


 "/usr/src/app/homeassistant/core.py", line 333, in async_run_job

target(*args)


 "/usr/src/app/homeassistant/components/utility_meter/sensor.py", line 94, in async_reading

old_state.state in [STATE_UNKNOWN, STATE_UNAVAILABLE],
AttributeError: 'NoneType' object has no attribute 'state'

Traceback (most recent call last):


 "/usr/local/bin/prospector", line 11, in <module>

load_entry_point('prospector==0.12.5', 'console_scripts', 'prospector')()


 "/usr/local/lib/python3.4/dist-packages/prospector/run.py", line 165, in main

prospector.execute()


 "/usr/local/lib/python3.4/dist-packages/prospector/run.py", line 66, in execute

messages += tool.run(found_files)


 "/usr/local/lib/python3.4/dist-packages/prospector/tools/pylint/__init__.py", line 232, in run

self._linter.check(self._args)


 "/usr/local/lib/python3.4/dist-packages/pylint/lint.py", line 726, in check

self._do_check(files_or_modules)


 "/usr/local/lib/python3.4/dist-packages/pylint/lint.py", line 855, in _do_check

self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)


 "/usr/local/lib/python3.4/dist-packages/pylint/lint.py", line 934, in check_astroid_module

walker.walk(ast_node)


 "/usr/local/lib/python3.4/dist-packages/pylint/utils.py", line 973, in walk

self.walk(child)


 "/usr/local/lib/python3.4/dist-packages/pylint/utils.py", line 973, in walk

self.walk(child)


 "/usr/local/lib/python3.4/dist-packages/pylint/utils.py", line 973, in walk

self.walk(child)


 "/usr/local/lib/python3.4/dist-packages/pylint/utils.py", line 970, in walk

cb(astroid)


 "/usr/local/lib/python3.4/dist-packages/pylint/checkers/typecheck.py", line 721, in visit_assign

function_node = safe_infer(node.value.func)


 "/usr/lib/python3.4/functools.py", line 472, in wrapper

result = user_function(*args, **kwds)


 "/usr/local/lib/python3.4/dist-packages/pylint/checkers/utils.py", line 777, in safe_infer

next(inferit)


 "/usr/local/lib/python3.4/dist-packages/astroid/decorators.py", line 85, in wrapped

res = next(generator)


 "/usr/local/lib/python3.4/dist-packages/astroid/decorators.py", line 138, in raise_if_nothing_inferred

yield next(generator)


 "/usr/local/lib/python3.4/dist-packages/astroid/inference.py", line 237, in infer_attribute

for owner in self.expr.infer(context):


 "/usr/local/lib/python3.4/dist-packages/astroid/context.py", line 40, in cache_generator

for result in generator:


 "/usr/local/lib/python3.4/dist-packages/astroid/decorators.py", line 85, in wrapped

res = next(generator)


 "/usr/local/lib/python3.4/dist-packages/astroid/bases.py", line 95, in _infer_stmts

for inferred in stmt.infer(context=context):


 "/usr/local/lib/python3.4/dist-packages/astroid/context.py", line 40, in cache_generator

for result in generator:


 "/usr/local/lib/python3.4/dist-packages/astroid/decorators.py", line 82, in wrapped

generator = _func(node, context, **kwargs)


 "/usr/local/lib/python3.4/dist-packages/astroid/inference.py", line 226, in infer_import_from

stmts = module.getattr(name, ignore_locals=module is self.root())


 "/usr/local/lib/python3.4/dist-packages/astroid/scoped_nodes.py", line 345, in getattr

result = [self.import_module(name, relative_only=True)]


 "/usr/local/lib/python3.4/dist-packages/astroid/scoped_nodes.py", line 409, in import_module

return MANAGER.ast_from_module_name(absmodname)


 "/usr/local/lib/python3.4/dist-packages/astroid/manager.py", line 133, in ast_from_module_name

modname=modname, path=spec.location, error=ex))
AttributeError: 'module' object has no attribute 'location'
