Skip to content

Commit

Permalink
Stricter check on incompatible get_range() arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
thobbs committed Jul 31, 2013
1 parent 486667f commit 3664309
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pycassa/columnfamily.py
Expand Up @@ -919,11 +919,16 @@ def get_range(self, start="", finish="", columns=None, column_start="",
count = 0
i = 0

if start_token and (start or finish):
if start_token is not None and (start not in ("", None) or finish not in ("", None)):
raise ValueError(
"ColumnFamily.get_range() received incompatible arguments: "
"'start_token' may not be used with 'start' or 'finish'")

if finish_token is not None and finish not in ("", None):
raise ValueError(
"ColumnFamily.get_range() received incompatible arguments: "
"'finish_token' may not be used with 'finish'")

if not start_token:
kr_args['start_key'] = self._pack_key(start)
else:
Expand Down

0 comments on commit 3664309

Please sign in to comment.