From e4e85e7fb8db73c8ace93a6a43b958379d12009e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20L=C3=B3pez?= Date: Mon, 26 Dec 2016 18:54:06 +0000 Subject: [PATCH] [FIX] method-NAME: Fix if value is not a string --- pylint_odoo/checkers/no_modules.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pylint_odoo/checkers/no_modules.py b/pylint_odoo/checkers/no_modules.py index 9bec2a69..0a105105 100644 --- a/pylint_odoo/checkers/no_modules.py +++ b/pylint_odoo/checkers/no_modules.py @@ -56,6 +56,7 @@ import types import astroid +from six import string_types from pylint.checkers import BaseChecker, utils from pylint.interfaces import IAstroidChecker @@ -317,8 +318,8 @@ def visit_call(self, node): if isinstance(argument, astroid.Keyword): argument_aux = argument.value if argument.arg in ['compute', 'search', 'inverse'] and \ - isinstance(argument.value, astroid.Const) and \ - argument_aux.value and \ + isinstance(argument_aux, astroid.Const) and \ + isinstance(argument_aux.value, string_types) and \ not argument_aux.value.startswith( '_' + argument.arg + '_'): self.add_message('method-' + argument.arg,