'with transaction' cannot work in Python 2.7.1

Bug #778734 reported by Daniel Holth
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ZODB
New
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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.