Mercurial > hg-stable
comparison mercurial/wireproto.py @ 25179:6dbbb4fa1892
wireproto: turn an 'except' into a 'finally' as suggest by the comment
Look! More hidden footprints!
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 18 May 2015 13:25:07 -0500 |
parents | 3f0744eeaeaf |
children | 41965bf23295 |
comparison
equal
deleted
inserted
replaced
25178:ebc41dae840a | 25179:6dbbb4fa1892 |
---|---|
805 fp.close() | 805 fp.close() |
806 yield data | 806 yield data |
807 else: | 807 else: |
808 for chunk in util.filechunkiter(sopener(name), limit=size): | 808 for chunk in util.filechunkiter(sopener(name), limit=size): |
809 yield chunk | 809 yield chunk |
810 # replace with "finally:" when support for python 2.4 has been dropped | 810 finally: |
811 except Exception: | |
812 sopener.mustaudit = oldaudit | 811 sopener.mustaudit = oldaudit |
813 raise | |
814 sopener.mustaudit = oldaudit | |
815 | 812 |
816 return streamres(streamer(repo, entries, total_bytes)) | 813 return streamres(streamer(repo, entries, total_bytes)) |
817 | 814 |
818 @wireprotocommand('unbundle', 'heads') | 815 @wireprotocommand('unbundle', 'heads') |
819 def unbundle(repo, proto, heads): | 816 def unbundle(repo, proto, heads): |