New submission from benrg <[email protected]>:
class MakeContextHandler:
def __init__(self, enter, exit):
self.__enter__ = enter
self.__exit__ = exit
with MakeContextHandler(lambda: None, lambda *e: None): pass
In 3.1.3 this worked; in 3.2 it raises AttributeError('__exit__'), which
appears to be a bug.
----------
components: Interpreter Core
messages: 130231
nosy: benrg
priority: normal
severity: normal
status: open
title: with statement looks up __exit__ incorrectly
type: behavior
versions: Python 3.2
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11428>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com