Commit a640cb90 authored by Kirill Smelkov's avatar Kirill Smelkov

*: Don't emit warnings on loadBefore

@d-maurer suggests to keep loadBefore without deprecation
(https://github.com/zopefoundation/ZODB/pull/323#pullrequestreview-650963363).

-> Don't emit warnings about deprecating loadBefore.

-> Keep the deprecation text in loadBefore interface, since loadBeforeEx
   should practically provide wider functionality without putting
   unnecessary constraint on storage implementations. In other words
   loadBefore deprecation is still there, but less aggressively
   advertised with the idea to make transition for outside-of-ZODB code
   to loadBeforeEx more smooth and with a bit more steps (we might want
   to reinstate the deprecation warnings at a later time).
parent d968a9a8
......@@ -24,7 +24,6 @@ import os
import random
import weakref
import tempfile
import warnings
import ZODB.BaseStorage
import ZODB.blob
import ZODB.interfaces
......@@ -228,9 +227,6 @@ class DemoStorage(ConflictResolvingStorage):
return ZODB.utils.loadBeforeEx(self.base, oid, before)
def loadBefore(self, oid, before):
warnings.warn("loadBefore is deprecated - use loadBeforeEx instead",
DeprecationWarning, stacklevel=2)
data, serial = self.loadBeforeEx(oid, before)
# find out next_serial.
......
......@@ -21,7 +21,6 @@ import errno
import logging
import os
import time
import warnings
from struct import pack
from struct import unpack
......@@ -594,8 +593,6 @@ class FileStorage(
return None, h.tid
def loadBefore(self, oid, tid):
warnings.warn("loadBefore is deprecated - use loadBeforeEx instead",
DeprecationWarning, stacklevel=2)
with self._files.get() as _file:
pos = self._lookup_pos(oid)
end_tid = None
......
......@@ -19,7 +19,6 @@ storage without distracting storage details.
import BTrees
import time
import warnings
import ZODB.BaseStorage
import ZODB.interfaces
import ZODB.POSException
......@@ -169,8 +168,6 @@ class MappingStorage(object):
# ZODB.interfaces.IStorage
@ZODB.utils.locked(opened)
def loadBefore(self, oid, tid):
warnings.warn("loadBefore is deprecated - use loadBeforeEx instead",
DeprecationWarning, stacklevel=2)
tid_data = self._data.get(oid)
if tid_data:
before = ZODB.utils.u64(tid)
......
......@@ -1322,8 +1322,6 @@ class StubStorage(object):
return data, serial
def loadBefore(self, oid, tid):
warnings.warn("loadBefore is deprecated - use loadBeforeEx instead",
DeprecationWarning, stacklevel=2)
return self._data[oid] + (None, )
def store(self, oid, serial, p, version, transaction):
......
......@@ -20,7 +20,6 @@ storage tests against the test storage.
"""
import bisect
import unittest
import warnings
from ZODB.BaseStorage import BaseStorage
from ZODB import POSException
......@@ -106,11 +105,6 @@ class MinimalMemoryStorage(BaseStorage, object):
self._ltid = self._tid
def loadBefore(self, the_oid, the_tid):
warnings.warn("loadBefore is deprecated - use loadBeforeEx instead",
DeprecationWarning, stacklevel=2)
return self._loadBefore(the_oid, the_tid)
def _loadBefore(self, the_oid, the_tid):
# It's okay if loadBefore() is really expensive, because this
# storage is just used for testing.
with self._lock:
......@@ -134,7 +128,7 @@ class MinimalMemoryStorage(BaseStorage, object):
def loadBeforeEx(self, oid, before):
try:
r = self._loadBefore(oid, before)
r = self.loadBefore(oid, before)
except KeyError:
return None, z64
if r is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment