Commit 31d945cf authored by Fred Drake's avatar Fred Drake

Replace apply(f,args,kw) with f(*args,**kw) to avoid deprecation warnings

from Python 2.3.
These warnings are displayed when running the unit tests.
This patch fixes the occurrances that are triggered by the unit tests;
there are probably others.
parent 3214c8db
...@@ -56,7 +56,7 @@ def get_timestamp(prev_ts=None): ...@@ -56,7 +56,7 @@ def get_timestamp(prev_ts=None):
the argument. the argument.
""" """
t = time.time() t = time.time()
t = apply(TimeStamp, (time.gmtime(t)[:5] + (t % 60,))) t = TimeStamp(*time.gmtime(t)[:5] + (t % 60,))
if prev_ts is not None: if prev_ts is not None:
t = t.laterThan(prev_ts) t = t.laterThan(prev_ts)
return t return t
......
...@@ -242,5 +242,5 @@ class CommitLockTests: ...@@ -242,5 +242,5 @@ class CommitLockTests:
def _get_timestamp(self): def _get_timestamp(self):
t = time.time() t = time.time()
t = apply(TimeStamp,(time.gmtime(t)[:5]+(t%60,))) t = TimeStamp(*time.gmtime(t)[:5]+(t%60,))
return `t` return `t`
...@@ -79,7 +79,7 @@ method:: ...@@ -79,7 +79,7 @@ method::
and call it to monitor the storage. and call it to monitor the storage.
""" """
__version__='$Revision: 1.18 $'[11:-2] __version__='$Revision: 1.19 $'[11:-2]
import base64, time, string import base64, time, string
from ZODB import POSException, BaseStorage, utils from ZODB import POSException, BaseStorage, utils
...@@ -436,7 +436,7 @@ class DemoStorage(BaseStorage.BaseStorage): ...@@ -436,7 +436,7 @@ class DemoStorage(BaseStorage.BaseStorage):
self._lock_acquire() self._lock_acquire()
try: try:
stop=`apply(TimeStamp, time.gmtime(t)[:5]+(t%60,))` stop=`TimeStamp(*time.gmtime(t)[:5]+(t%60,))`
_data=self._data _data=self._data
# Build indexes up to the pack time: # Build indexes up to the pack time:
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version # may have a back pointer to a version record or to a non-version
# record. # record.
# #
__version__='$Revision: 1.135 $'[11:-2] __version__='$Revision: 1.136 $'[11:-2]
import base64 import base64
from cPickle import Pickler, Unpickler, loads from cPickle import Pickler, Unpickler, loads
...@@ -293,7 +293,7 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -293,7 +293,7 @@ class FileStorage(BaseStorage.BaseStorage,
self._ts = tid = TimeStamp(tid) self._ts = tid = TimeStamp(tid)
t = time.time() t = time.time()
t = apply(TimeStamp, (time.gmtime(t)[:5] + (t % 60,))) t = TimeStamp(*time.gmtime(t)[:5] + (t % 60,))
if tid > t: if tid > t:
warn("%s Database records in the future", file_name); warn("%s Database records in the future", file_name);
if tid.timeTime() - t.timeTime() > 86400*30: if tid.timeTime() - t.timeTime() > 86400*30:
...@@ -1460,7 +1460,7 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -1460,7 +1460,7 @@ class FileStorage(BaseStorage.BaseStorage,
if self._is_read_only: if self._is_read_only:
raise POSException.ReadOnlyError() raise POSException.ReadOnlyError()
stop=`apply(TimeStamp, time.gmtime(t)[:5]+(t%60,))` stop=`TimeStamp(*time.gmtime(t)[:5]+(t%60,))`
if stop==z64: raise FileStorageError, 'Invalid pack time' if stop==z64: raise FileStorageError, 'Invalid pack time'
# If the storage is empty, there's nothing to do. # If the storage is empty, there's nothing to do.
......
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