[Zodb-checkins] SVN: ZODB/trunk/src/ The old commit hook spelling
will actually be removed
Tim Peters
tim.one at comcast.net
Thu Sep 1 20:19:50 EDT 2005
Log message for revision 38230:
The old commit hook spelling will actually be removed
in 3.8 (it didn't get released in ZODB 3.5; will be
released in ZODB 3.6).
Changed:
U ZODB/trunk/src/ZODB/utils.py
U ZODB/trunk/src/transaction/_transaction.py
U ZODB/trunk/src/transaction/interfaces.py
U ZODB/trunk/src/transaction/tests/test_transaction.py
-=-
Modified: ZODB/trunk/src/ZODB/utils.py
===================================================================
--- ZODB/trunk/src/ZODB/utils.py 2005-09-01 23:52:30 UTC (rev 38229)
+++ ZODB/trunk/src/ZODB/utils.py 2005-09-02 00:19:50 UTC (rev 38230)
@@ -39,6 +39,7 @@
'DEPRECATED_ARGUMENT',
'deprecated36',
'deprecated37',
+ 'deprecated38',
'get_pickle_metadata',
]
@@ -65,6 +66,13 @@
warnings.warn("This will be removed in ZODB 3.7:\n%s" % msg,
DeprecationWarning, stacklevel=3)
+# Raise DeprecationWarning, noting that the deprecated thing will go
+# away in ZODB 3.8. Point to the caller of our caller (i.e., at the
+# code using the deprecated thing).
+def deprecated38(msg):
+ warnings.warn("This will be removed in ZODB 3.8:\n%s" % msg,
+ DeprecationWarning, stacklevel=3)
+
z64 = '\0'*8
assert sys.hexversion >= 0x02030000
Modified: ZODB/trunk/src/transaction/_transaction.py
===================================================================
--- ZODB/trunk/src/transaction/_transaction.py 2005-09-01 23:52:30 UTC (rev 38229)
+++ ZODB/trunk/src/transaction/_transaction.py 2005-09-02 00:19:50 UTC (rev 38230)
@@ -430,9 +430,9 @@
self._before_commit_index += 1
def beforeCommitHook(self, hook, *args, **kws):
- from ZODB.utils import deprecated37
+ from ZODB.utils import deprecated38
- deprecated37("Use addBeforeCommitHook instead of beforeCommitHook.")
+ deprecated38("Use addBeforeCommitHook instead of beforeCommitHook.")
# Default order is zero.
self.addBeforeCommitHook(hook, args, kws, order=0)
Modified: ZODB/trunk/src/transaction/interfaces.py
===================================================================
--- ZODB/trunk/src/transaction/interfaces.py 2005-09-01 23:52:30 UTC (rev 38229)
+++ ZODB/trunk/src/transaction/interfaces.py 2005-09-02 00:19:50 UTC (rev 38230)
@@ -167,11 +167,11 @@
raise an exception, or remove `<name, value>` pairs).
"""
- # deprecated37
+ # deprecated38
def beforeCommitHook(__hook, *args, **kws):
"""Register a hook to call before the transaction is committed.
- THIS IS DEPRECATED IN ZODB 3.5. Use addBeforeCommitHook() instead.
+ THIS IS DEPRECATED IN ZODB 3.6. Use addBeforeCommitHook() instead.
The specified hook function will be called after the transaction's
commit method has been called, but before the commit process has been
Modified: ZODB/trunk/src/transaction/tests/test_transaction.py
===================================================================
--- ZODB/trunk/src/transaction/tests/test_transaction.py 2005-09-01 23:52:30 UTC (rev 38229)
+++ ZODB/trunk/src/transaction/tests/test_transaction.py 2005-09-02 00:19:50 UTC (rev 38230)
@@ -436,7 +436,7 @@
self.assertRaises(ValueError, t.addBeforeCommitHook,
hook, order=foo())
-# deprecated37; remove this then
+# deprecated38; remove this then
def test_beforeCommitHook():
"""Test beforeCommitHook.
@@ -474,7 +474,7 @@
1
>>> message, category, filename, lineno = whook.warnings[0]
>>> print message
- This will be removed in ZODB 3.7:
+ This will be removed in ZODB 3.8:
Use addBeforeCommitHook instead of beforeCommitHook.
>>> category.__name__
'DeprecationWarning'
More information about the Zodb-checkins
mailing list