Closed GoogleCodeExporter closed 9 years ago
Tests to reproduce the issue.
Original comment by bouf10@gmail.com
on 3 Jan 2010 at 9:54
Attachments:
What is the usecase for patching the same attribute twice?
Original comment by fuzzyman
on 3 Jan 2010 at 10:01
[deleted comment]
I think you're right about the 'onion peel'. I'll see if I can make it work
when used
as a context manager as well.
Original comment by fuzzyman
on 3 Jan 2010 at 11:10
No real use case except when the developer do it by error. The problem is that
it
seems to create a strange side effect where other methods decorated executed
after
starts to fail.
So I thought that it can hide a more deeper bug. And since other tests begin to
fail,
it took me some time to identified that the real problem was not the failed
test but
the other one that has a double patch...
Anyway, there is a patch to solve the problem with a decorator (@patch) but not
for
the with statement.
The problem was in the execution order of the __exit__ method. I think that it
should
be executed in the reverse order from __enter__ (like an onion peel).
(Sorry I'm not used to GoogleCode, I had to repost this comment)
Original comment by bouf10@gmail.com
on 3 Jan 2010 at 11:16
Attachments:
Finally, it shows up that the remaining bug with the with statement was in the
test
itself...
So this is my patch to fix the issue 21 (the test is included to prevent
regression).
Patch is against SVN r99.
Original comment by bouf10@gmail.com
on 4 Jan 2010 at 1:32
Attachments:
Original comment by fuzzyman
on 11 Jun 2010 at 12:02
Original comment by fuzzyman
on 12 Jun 2010 at 11:23
Original comment by fuzzyman
on 13 Jun 2010 at 8:41
Original comment by kon...@gmail.com
on 13 Jun 2010 at 9:31
Original issue reported on code.google.com by
bouf10@gmail.com
on 3 Jan 2010 at 9:52