Commit 9533ddd4 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 1375b51e
......@@ -56,7 +56,7 @@ def get_timestamp(prev_ts=None):
the argument.
"""
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:
t = t.laterThan(prev_ts)
return t
......
......@@ -242,5 +242,5 @@ class CommitLockTests:
def _get_timestamp(self):
t = time.time()
t = apply(TimeStamp,(time.gmtime(t)[:5]+(t%60,)))
t = TimeStamp(*time.gmtime(t)[:5]+(t%60,))
return `t`
......@@ -79,7 +79,7 @@ method::
and call it to monitor the storage.
"""
__version__='$Revision: 1.18 $'[11:-2]
__version__='$Revision: 1.19 $'[11:-2]
import base64, time, string
from ZODB import POSException, BaseStorage, utils
......@@ -436,7 +436,7 @@ class DemoStorage(BaseStorage.BaseStorage):
self._lock_acquire()
try:
stop=`apply(TimeStamp, time.gmtime(t)[:5]+(t%60,))`
stop=`TimeStamp(*time.gmtime(t)[:5]+(t%60,))`
_data=self._data
# Build indexes up to the pack time:
......
......@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version
# record.
#
__version__='$Revision: 1.135 $'[11:-2]
__version__='$Revision: 1.136 $'[11:-2]
import base64
from cPickle import Pickler, Unpickler, loads
......@@ -293,7 +293,7 @@ class FileStorage(BaseStorage.BaseStorage,
self._ts = tid = TimeStamp(tid)
t = time.time()
t = apply(TimeStamp, (time.gmtime(t)[:5] + (t % 60,)))
t = TimeStamp(*time.gmtime(t)[:5] + (t % 60,))
if tid > t:
warn("%s Database records in the future", file_name);
if tid.timeTime() - t.timeTime() > 86400*30:
......@@ -1460,7 +1460,7 @@ class FileStorage(BaseStorage.BaseStorage,
if self._is_read_only:
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 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