[Python-checkins] r66137 - in python/trunk: Lib/bsddb/__init__.py Lib/bsddb/test/test_all.py Modules/bsddb.h

jesus.cea python-checkins at python.org
Tue Sep 2 04:29:06 CEST 2008


Author: jesus.cea
Date: Tue Sep 2 04:29:06 2008
New Revision: 66137
Log:
Improve compatibility with Python3.0 testsuite
Modified:
 python/trunk/Lib/bsddb/__init__.py
 python/trunk/Lib/bsddb/test/test_all.py
 python/trunk/Modules/bsddb.h
Modified: python/trunk/Lib/bsddb/__init__.py
==============================================================================
--- python/trunk/Lib/bsddb/__init__.py	(original)
+++ python/trunk/Lib/bsddb/__init__.py	Tue Sep 2 04:29:06 2008
@@ -110,7 +110,7 @@
 key = _DeadlockWrap(cur.first, 0,0,0)[0]
 yield key
 
- next = cur.next
+ next = getattr(cur, "next")
 while 1:
 try:
 key = _DeadlockWrap(next, 0,0,0)[0]
@@ -123,7 +123,7 @@
 # FIXME-20031101-greg: race condition. cursor could
 # be closed by another thread before this call.
 _DeadlockWrap(cur.set, key,0,0,0)
- next = cur.next
+ next = getattr(cur, "next")
 except _bsddb.DBNotFoundError:
 pass
 except _bsddb.DBCursorClosedError:
@@ -152,7 +152,7 @@
 key = kv[0]
 yield kv
 
- next = cur.next
+ next = getattr(cur, "next")
 while 1:
 try:
 kv = _DeadlockWrap(next)
@@ -166,7 +166,7 @@
 # FIXME-20031101-greg: race condition. cursor could
 # be closed by another thread before this call.
 _DeadlockWrap(cur.set, key,0,0,0)
- next = cur.next
+ next = getattr(cur, "next")
 except _bsddb.DBNotFoundError:
 pass
 except _bsddb.DBCursorClosedError:
@@ -302,12 +302,15 @@
 self._checkCursor()
 return _DeadlockWrap(self.dbc.set_range, key)
 
- def next(self):
+ def next(self): # Renamed by "2to3"
 self._checkOpen()
 self._checkCursor()
- rv = _DeadlockWrap(self.dbc.next)
+ rv = _DeadlockWrap(getattr(self.dbc, "next"))
 return rv
 
+ if sys.version_info[0] >= 3 : # For "2to3" conversion
+ next = __next__
+
 def previous(self):
 self._checkOpen()
 self._checkCursor()
Modified: python/trunk/Lib/bsddb/test/test_all.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_all.py	(original)
+++ python/trunk/Lib/bsddb/test/test_all.py	Tue Sep 2 04:29:06 2008
@@ -33,6 +33,8 @@
 v = getattr(self._dbcursor, "next")()
 return self._fix(v)
 
+ next = __next__
+
 def previous(self) :
 v = self._dbcursor.previous()
 return self._fix(v)
Modified: python/trunk/Modules/bsddb.h
==============================================================================
--- python/trunk/Modules/bsddb.h	(original)
+++ python/trunk/Modules/bsddb.h	Tue Sep 2 04:29:06 2008
@@ -105,7 +105,7 @@
 #error "eek! DBVER can't handle minor versions > 9"
 #endif
 
-#define PY_BSDDB_VERSION "4.7.3pre2"
+#define PY_BSDDB_VERSION "4.7.3pre3"
 
 /* Python object definitions */
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /