mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-20 06:10:59 +00:00
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:
parent
ab5c841c9b
commit
bc4c413664
1 changed files with 6 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue