Skip to content
Snippets Groups Projects
Commit 3119dc15 authored by Simon Heimberg's avatar Simon Heimberg
Browse files

check-code: do not abort on an unreadable file, only report this

parent ca76e77d
No related branches found
No related tags found
No related merge requests found
......@@ -407,7 +407,11 @@
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:
......
......@@ -187,8 +187,9 @@
> # 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]
......@@ -191,4 +192,5 @@
raise-format.py:1:
> raise SomeException, message
don't use old-style two-argument raise, use Exception(message)
[1]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment