Skip to content

Commit

Permalink
Merge pull request #98 from vauxoo-dev/master-oca-fix-startswith-moy
Browse files Browse the repository at this point in the history
[FIX] method-NAME: Fix if value is not a string
  • Loading branch information
pedrobaeza committed Dec 26, 2016
2 parents 2370e52 + e4e85e7 commit 9f1458a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pylint_odoo/checkers/no_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import types

import astroid
from six import string_types
from pylint.checkers import BaseChecker, utils
from pylint.interfaces import IAstroidChecker

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9f1458a

Please sign in to comment.