[Zodb-checkins] SVN: ZODB/branches/3.3/ Transaction.begin().

Tim Peters tim.one at comcast.net
Mon Sep 27 15:45:14 EDT 2004


Log message for revision 27695:
  Transaction.begin().
  
  When raising DeprecationWarning, point the warning machinery at
  the caller, not at Transaction.begin() itself.  As is (voice
  of experience <wink>), these warnings are darned near useless to
  track down code that needs to be changed on Zope trunk.  With the
  change, the warnings point directly at the deprecated uses.
  


Changed:
  U   ZODB/branches/3.3/NEWS.txt
  U   ZODB/branches/3.3/src/transaction/_transaction.py


-=-
Modified: ZODB/branches/3.3/NEWS.txt
===================================================================
--- ZODB/branches/3.3/NEWS.txt	2004-09-27 15:44:33 UTC (rev 27694)
+++ ZODB/branches/3.3/NEWS.txt	2004-09-27 19:45:14 UTC (rev 27695)
@@ -9,7 +9,13 @@
 type ``byte-size``.  This allows you to specify, for example,
 "``cache-size 20MB``" to get a 20 megabyte cache.
 
+transaction
+-----------
 
+The deprecation warning for ``Transaction.begin()`` was changed to
+point to the caller, instead of to ``Transaction.begin()`` itself.
+
+
 What's new in ZODB3 3.3 release candidate 1?
 ============================================
 Release date: 14-Sep-2004

Modified: ZODB/branches/3.3/src/transaction/_transaction.py
===================================================================
--- ZODB/branches/3.3/src/transaction/_transaction.py	2004-09-27 15:44:33 UTC (rev 27694)
+++ ZODB/branches/3.3/src/transaction/_transaction.py	2004-09-27 19:45:14 UTC (rev 27695)
@@ -263,7 +263,7 @@
     def begin(self):
         warnings.warn("Transaction.begin() should no longer be used; use "
                       "the begin() method of a transaction manager.",
-                      DeprecationWarning)
+                      DeprecationWarning, stacklevel=2)
         if (self._resources or
               self._sub or
               self._nonsub or



More information about the Zodb-checkins mailing list