Guido van Rossum wrote:
> [Phillip J. Eby]
>>* The transaction handler could also be written as:
>>
>>     @with_template
>>     def transactional(db):
>>         db.begin()
>>         try:
>>             yield db
>>         except:
>>             db.rollback()
>>         else:
>>             db.commit()
>>
>>at least, if I understand it correctly.
> 
> 
> Ah, of course. I've updated the PEP.
> 

This template eats eats the exception, which will cause a RuntimeError
in the proposed Wrapper, I think.  A raise after rollback is needed.

- Arnold
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to