comparison mercurial/patch.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 e34106fa0dc3
children 107a3270a24a
comparison
equal deleted inserted replaced
16704:1f3acc30bdfe 16705:c2d9ef43ff6c
243 tmpfp.write(payload) 243 tmpfp.write(payload)
244 if not payload.endswith('\n'): 244 if not payload.endswith('\n'):
245 tmpfp.write('\n') 245 tmpfp.write('\n')
246 elif not diffs_seen and message and content_type == 'text/plain': 246 elif not diffs_seen and message and content_type == 'text/plain':
247 message += '\n' + payload 247 message += '\n' + payload
248 except: 248 except: # re-raises
249 tmpfp.close() 249 tmpfp.close()
250 os.unlink(tmpname) 250 os.unlink(tmpname)
251 raise 251 raise
252 252
253 if subject and not message.startswith(subject): 253 if subject and not message.startswith(subject):