Commit e2ee27e4 authored by Marius Gedminas's avatar Marius Gedminas

Preserve the original exception traceback in OrderedContainer.__setitem__.

I tried to adjust the doctest to ensure the traceback is not lost, but
as soon as I start it with a '...' (because I don't care about oldest frames),
the doctest comparator ignores everything about the traceback.
parent 14068feb
...@@ -8,6 +8,8 @@ CHANGES ...@@ -8,6 +8,8 @@ CHANGES
- Send ``IContainerModifiedEvent`` *after* the container is modified - Send ``IContainerModifiedEvent`` *after* the container is modified
(LP#705600). (LP#705600).
- Preserve the original exception traceback in OrderedContainer.__setitem__.
3.12.0 (2010-12-14) 3.12.0 (2010-12-14)
------------------- -------------------
......
...@@ -211,10 +211,10 @@ class OrderedContainer(Persistent, Contained): ...@@ -211,10 +211,10 @@ class OrderedContainer(Persistent, Contained):
# This function creates a lot of events that other code listens to. # This function creates a lot of events that other code listens to.
try: try:
setitem(self, self._data.__setitem__, key, object) setitem(self, self._data.__setitem__, key, object)
except Exception, e: except Exception:
if not existed: if not existed:
self._order.remove(key) self._order.remove(key)
raise e raise
return key return key
......
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