Fix TypeError: hasattr(): attribute name must be string

The one test failure in Travis happens in
TestConsole.test_internal_error, but only if you have the argcomplete
package installed.

This was a real bug in error reporting code.
This commit is contained in:
Marius Gedminas 2017-02-01 16:02:35 +02:00
parent 2ce06d6e55
commit 3c99b6aa30

View file

@ -81,7 +81,7 @@ def get_modules_info():
for (mod, name, version_attr) in Modules:
if not fileutil.has_module(mod):
continue
if hasattr(mod, version_attr):
if version_attr and hasattr(mod, version_attr):
attr = getattr(mod, version_attr)
version = attr() if callable(attr) else attr
module_infos.append("%s %s" % (name, version))