comparison mercurial/util.py @ 16705:c2d9ef43ff6c

check-code: ignore naked excepts with a "re-raise" comment This also promotes the naked except check from a warning to an error.
author Brodie Rao <brodie@sf.io>
date Sun, 13 May 2012 13:18:06 +0200
parents 7292a4618f46
children e406b9656da3
comparison
equal deleted inserted replaced
16704:1f3acc30bdfe 16705:c2d9ef43ff6c
758 ofp = posixfile(temp, "wb") 758 ofp = posixfile(temp, "wb")
759 for chunk in filechunkiter(ifp): 759 for chunk in filechunkiter(ifp):
760 ofp.write(chunk) 760 ofp.write(chunk)
761 ifp.close() 761 ifp.close()
762 ofp.close() 762 ofp.close()
763 except: 763 except: # re-raises
764 try: os.unlink(temp) 764 try: os.unlink(temp)
765 except OSError: pass 765 except OSError: pass
766 raise 766 raise
767 return temp 767 return temp
768 768