Permalink
Browse files

Stricter check on incompatible get_range() arguments

  • Loading branch information...
thobbs committed Jul 31, 2013
1 parent 486667f commit 3664309d01c0a24547b11e7e6325c21296229287
Showing with 6 additions and 1 deletion.
  1. +6 −1 pycassa/columnfamily.py
View
@@ -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:

0 comments on commit 3664309

Please sign in to comment.