diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-07-15 09:42:47 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-07-15 09:42:47 +1000 |
commit | a2dbd9a5aa6116f795c195bd4d0adb47c6c53d91 (patch) | |
tree | 5d96c75b173efc412beee553dcb0595ab3c7d88a /lang | |
parent | 516ea01bebf242fbd715b98320ac79f393e44729 (diff) | |
download | mongo-a2dbd9a5aa6116f795c195bd4d0adb47c6c53d91.tar.gz |
Fix several issues in the unit tests and the Python API so that all unit tests now pass:
* if an open_cursor operation fails, don't attempt to modify the cursor
* the cursor iteration code has to stop on WT_NOTFOUND
* some config strings have been renamed (internal_* rather than intl_*)
Diffstat (limited to 'lang')
-rw-r--r-- | lang/python/wiredtiger.i | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lang/python/wiredtiger.i b/lang/python/wiredtiger.i index 39ae74a2ddf..d1ec9f00778 100644 --- a/lang/python/wiredtiger.i +++ b/lang/python/wiredtiger.i @@ -37,14 +37,15 @@ from packing import pack, unpack } %typemap(argout) WT_CURSOR ** { - (*$1)->flags |= WT_CURSTD_RAW; $result = SWIG_NewPointerObj(SWIG_as_voidptr(*$1), SWIGTYPE_p_wt_cursor, 0); - PyObject_SetAttrString($result, "is_column", - PyBool_FromLong(strcmp((*$1)->key_format, "r") == 0)); + if (*$1 != NULL) { + (*$1)->flags |= WT_CURSTD_RAW; + PyObject_SetAttrString($result, "is_column", + PyBool_FromLong(strcmp((*$1)->key_format, "r") == 0)); + } } - /* * Error returns other than WT_NOTFOUND generate an exception. * Use our own exception type, in future tailored to the kind @@ -190,9 +191,7 @@ SELFHELPER(struct wt_cursor) return self def next(self): - try: - self._next() - except WiredTigerError: + if self._next() == WT_NOTFOUND: raise StopIteration return self.get_keys() + self.get_values() %} |