From a08f325f201b2d356df025f663c216b9c62fab9c Mon Sep 17 00:00:00 2001 From: Tatu Aalto Date: Tue, 4 Oct 2016 22:29:01 +0300 Subject: [PATCH] Builtin modules may not contain __dict__ attribute Fixes 169 --- dataparser/data_parser/data_parser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dataparser/data_parser/data_parser.py b/dataparser/data_parser/data_parser.py index 41f4aa3..60fbbd2 100644 --- a/dataparser/data_parser/data_parser.py +++ b/dataparser/data_parser/data_parser.py @@ -168,8 +168,12 @@ def _get_keywords_with_robot_name(self, libcode): kw_deco = {} for key in libcode.__dict__: if callable(libcode.__dict__[key]): - if 'robot_name' in libcode.__dict__[key].__dict__: - kw_deco[libcode.__dict__[key].__dict__['robot_name']] = key + try: + if 'robot_name' in libcode.__dict__[key].__dict__: + kw = libcode.__dict__[key].__dict__['robot_name'] + kw_deco[kw] = key + except AttributeError: + pass return kw_deco def _get_library_kw_source(self, libcode, keyword):