Fixes SF bug # 778421

 * Fixed a bug in the compatibility interface set_location() method
   where it would not properly search to the next nearest key when
   used on BTree databases.  [SF bug id 788421]
 * Fixed a bug in the compatibility interface set_location() method
   where it could crash when looking up keys in a hash or recno
   format database due to an incorrect free().
diff --git a/Lib/bsddb/__init__.py b/Lib/bsddb/__init__.py
index 9c59b00..90bf92b 100644
--- a/Lib/bsddb/__init__.py
+++ b/Lib/bsddb/__init__.py
@@ -244,7 +244,7 @@
     def set_location(self, key):
         self._checkOpen()
         self._checkCursor()
-        return self.dbc.set(key)
+        return self.dbc.set_range(key)
 
     def next(self):
         self._checkOpen()