git » nmdb » commit 27fdbc3

Make the Python binding cas operation return the same as the C one.

author Alberto Bertogli
2007-06-24 07:44:56 UTC
committer Alberto Bertogli
2007-06-24 07:44:56 UTC
parent 77d14f5f748aaa7b9cfbc845e2e1ec9cf56c6e21

Make the Python binding cas operation return the same as the C one.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

bindings/python/nmdb.py +2 -2

diff --git a/bindings/python/nmdb.py b/bindings/python/nmdb.py
index ea45a3f..4d0dccc 100644
--- a/bindings/python/nmdb.py
+++ b/bindings/python/nmdb.py
@@ -138,10 +138,10 @@ class _nmdbDict (object):
 		r = self._cas(key, oldval, newval)
 		if r == 2:
 			# success
-			return 1
+			return 2
 		elif r == 1:
 			# no match
-			return 0
+			return 1
 		elif r == 0:
 			# not in
 			raise KeyError