Mercurial > public > mercurial-scm > hg-stable
comparison contrib/check-code.py @ 19494:3119dc155ac2 stable
check-code: do not abort on an unreadable file, only report this
author | Simon Heimberg <simohe@besonet.ch> |
---|---|
date | Mon, 22 Jul 2013 10:04:45 +0200 |
parents | d9e86d656017 |
children | 725507cd5216 |
comparison
equal
deleted
inserted
replaced
19493:ca76e77dd663 | 19494:3119dc155ac2 |
---|---|
405 if not re.match(match, f): | 405 if not re.match(match, f): |
406 if debug: | 406 if debug: |
407 print "Skipping %s for %s it doesn't match %s" % ( | 407 print "Skipping %s for %s it doesn't match %s" % ( |
408 name, match, f) | 408 name, match, f) |
409 continue | 409 continue |
410 fp = open(f) | 410 try: |
411 fp = open(f) | |
412 except IOError, e: | |
413 print "Skipping %s, %s" % (f, str(e).split(':', 1)[0]) | |
414 continue | |
411 pre = post = fp.read() | 415 pre = post = fp.read() |
412 fp.close() | 416 fp.close() |
413 if "no-" "check-code" in pre: | 417 if "no-" "check-code" in pre: |
414 if debug: | 418 if debug: |
415 print "Skipping %s for %s it has no-" " check-code" % ( | 419 print "Skipping %s for %s it has no-" " check-code" % ( |