diff options
author | cpopa <devnull@localhost> | 2013-10-08 19:21:28 +0300 |
---|---|---|
committer | cpopa <devnull@localhost> | 2013-10-08 19:21:28 +0300 |
commit | 7930f6685c0b4706b0ca9fa1c910049dea7913ee (patch) | |
tree | 67e6d122bf084056dcf58219b8f76b19d3329360 /checkers/utils.py | |
parent | 8cfc7f6be64bc107beea841f61680c7111d3d9bf (diff) | |
download | pylint-7930f6685c0b4706b0ca9fa1c910049dea7913ee.tar.gz |
Allow get_argument_from_call to retrieve the first positional argument.
Diffstat (limited to 'checkers/utils.py')
-rw-r--r-- | checkers/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/checkers/utils.py b/checkers/utils.py index 68b5469..5e028f2 100644 --- a/checkers/utils.py +++ b/checkers/utils.py @@ -394,10 +394,10 @@ def get_argument_from_call(callfunc_node, position=None, keyword=None): :raises NoSuchArgumentError: if no argument at the provided position or with the provided keyword. """ - if not position and not keyword: + if position is None and keyword is None: raise ValueError('Must specify at least one of: position or keyword.') try: - if position and not isinstance(callfunc_node.args[position], astroid.Keyword): + if position is not None and not isinstance(callfunc_node.args[position], astroid.Keyword): return callfunc_node.args[position] except IndexError as error: raise NoSuchArgumentError(error) |