Use OSError instead of alias IOError
https://docs.astral.sh/ruff/rules/os-error-alias/ Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
parent
6c0b816e73
commit
a03b420c75
@ -128,7 +128,7 @@ def scan_pkg(pkg, options):
|
||||
fp = helpers.urlopen(url)
|
||||
except urllib.error.URLError:
|
||||
return []
|
||||
except IOError:
|
||||
except OSError:
|
||||
return []
|
||||
|
||||
if not fp:
|
||||
|
@ -112,7 +112,7 @@ def scan_directory_recursive(cp, ver, rev, url, steps, orig_url, options):
|
||||
fp = helpers.urlopen(url)
|
||||
except urllib.error.URLError:
|
||||
return []
|
||||
except IOError:
|
||||
except OSError:
|
||||
return []
|
||||
|
||||
if not fp:
|
||||
|
@ -50,7 +50,7 @@ def scan_pkg(pkg, options):
|
||||
fp = helpers.urlopen(url)
|
||||
except urllib.error.URLError:
|
||||
return []
|
||||
except IOError:
|
||||
except OSError:
|
||||
return []
|
||||
|
||||
if not fp:
|
||||
|
@ -58,7 +58,7 @@ def scan_pkg(pkg, options):
|
||||
fp = helpers.urlopen(url)
|
||||
except urllib.error.URLError:
|
||||
return []
|
||||
except IOError:
|
||||
except OSError:
|
||||
return []
|
||||
|
||||
if not fp:
|
||||
|
@ -45,7 +45,7 @@ def handle_directory_patterns(base, file_pattern):
|
||||
fp = helpers.urlopen(basedir)
|
||||
except urllib.error.URLError:
|
||||
return []
|
||||
except IOError:
|
||||
except OSError:
|
||||
return []
|
||||
|
||||
if not fp:
|
||||
|
@ -280,7 +280,7 @@ def urlallowed(url):
|
||||
try:
|
||||
rp.read()
|
||||
rpcache[baseurl] = rp
|
||||
except IOError:
|
||||
except OSError:
|
||||
rp = None
|
||||
|
||||
setdefaulttimeout(timeout)
|
||||
@ -370,7 +370,7 @@ def tryurl(fileurl, template):
|
||||
|
||||
except urllib.error.URLError:
|
||||
result = None
|
||||
except IOError:
|
||||
except OSError:
|
||||
result = None
|
||||
|
||||
euscan.output.eend(errno.ENOENT if not result else 0)
|
||||
|
Loading…
Reference in New Issue
Block a user