Commit 154887a6 authored by Jim Fulton's avatar Jim Fulton

Added missing data attribute for conflict errors.

parent 03c08efa
......@@ -25,6 +25,8 @@ General
- (3.8.0b3) Make it possible to examine oid and (in some situations) database
name of persistent object references during conflict resolution.
- (3.8.0b3) Added missing data attribute for conflict errors.
ZEO
---
......
......@@ -106,12 +106,11 @@ class ConflictError(TransactionError):
# avoid circular import chain
from ZODB.utils import get_pickle_metadata
self.class_name = "%s.%s" % get_pickle_metadata(data)
## else:
## if message != "data read conflict error":
## raise RuntimeError
self.serials = serials
self.data = data
def __str__(self):
extras = []
if self.oid:
......
##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Misc tests :)
"""
import unittest
from zope.testing import doctest
def conflict_error_retains_data_passed():
r"""
ConflictError can be passed a data record which it claims to retain as
an attribute.
>>> import ZODB.POSException
>>>
>>> ZODB.POSException.ConflictError(data='cM\nC\n').data
'cM\nC\n'
"""
def test_suite():
return unittest.TestSuite((
doctest.DocTestSuite(),
))
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