diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -407,7 +407,11 @@ def checkfile(f, logfunc=_defaultlogger. print "Skipping %s for %s it doesn't match %s" % ( name, match, f) continue - fp = open(f) + try: + fp = open(f) + except IOError, e: + print "Skipping %s, %s" % (f, str(e).split(':', 1)[0]) + continue pre = post = fp.read() fp.close() if "no-" "check-code" in pre: diff --git a/tests/test-check-code.t b/tests/test-check-code.t --- a/tests/test-check-code.t +++ b/tests/test-check-code.t @@ -187,8 +187,10 @@ > # this next line is okay > raise SomeException(arg1, arg2) > EOF - $ "$check_code" raise-format.py + $ "$check_code" not-existing.py raise-format.py + Skipping*not-existing.py* (glob) raise-format.py:1: > raise SomeException, message don't use old-style two-argument raise, use Exception(message) [1] +