Catch OSError in test functions

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3978 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2009-02-20 10:18:30 +00:00
parent ab5c841c9b
commit bc4c413664

View file

@ -46,9 +46,12 @@ class memoized (object):
def _run (cmd):
null = open(os.name == 'nt' and ':NUL' or "/dev/null", 'w')
try:
return subprocess.call(cmd, stdout=null, stderr=subprocess.STDOUT)
finally:
null.close()
try:
return subprocess.call(cmd, stdout=null, stderr=subprocess.STDOUT)
finally:
null.close()
except OSError:
return -1
@memoized