'with transaction' cannot work in Python 2.7.1

Bug #778734 reported by Daniel Holth on 2011-05-06
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ZODB
Undecided
Unassigned

Bug Description

In Python 2.7.1: import transaction; with transaction: pass
>>> AttributeError: __exit__

I think this is because Python bypasses __getattribute__ when looking up __enter__ and __exit__. Instead, `with transaction.manager: pass`

http://docs.python.org/reference/datamodel.html#special-method-lookup-for-new-style-classes

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers