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)
|
fp = helpers.urlopen(url)
|
||||||
except urllib.error.URLError:
|
except urllib.error.URLError:
|
||||||
return []
|
return []
|
||||||
except IOError:
|
except OSError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
if not fp:
|
if not fp:
|
||||||
|
@ -112,7 +112,7 @@ def scan_directory_recursive(cp, ver, rev, url, steps, orig_url, options):
|
|||||||
fp = helpers.urlopen(url)
|
fp = helpers.urlopen(url)
|
||||||
except urllib.error.URLError:
|
except urllib.error.URLError:
|
||||||
return []
|
return []
|
||||||
except IOError:
|
except OSError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
if not fp:
|
if not fp:
|
||||||
|
@ -50,7 +50,7 @@ def scan_pkg(pkg, options):
|
|||||||
fp = helpers.urlopen(url)
|
fp = helpers.urlopen(url)
|
||||||
except urllib.error.URLError:
|
except urllib.error.URLError:
|
||||||
return []
|
return []
|
||||||
except IOError:
|
except OSError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
if not fp:
|
if not fp:
|
||||||
|
@ -58,7 +58,7 @@ def scan_pkg(pkg, options):
|
|||||||
fp = helpers.urlopen(url)
|
fp = helpers.urlopen(url)
|
||||||
except urllib.error.URLError:
|
except urllib.error.URLError:
|
||||||
return []
|
return []
|
||||||
except IOError:
|
except OSError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
if not fp:
|
if not fp:
|
||||||
|
@ -45,7 +45,7 @@ def handle_directory_patterns(base, file_pattern):
|
|||||||
fp = helpers.urlopen(basedir)
|
fp = helpers.urlopen(basedir)
|
||||||
except urllib.error.URLError:
|
except urllib.error.URLError:
|
||||||
return []
|
return []
|
||||||
except IOError:
|
except OSError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
if not fp:
|
if not fp:
|
||||||
|
@ -280,7 +280,7 @@ def urlallowed(url):
|
|||||||
try:
|
try:
|
||||||
rp.read()
|
rp.read()
|
||||||
rpcache[baseurl] = rp
|
rpcache[baseurl] = rp
|
||||||
except IOError:
|
except OSError:
|
||||||
rp = None
|
rp = None
|
||||||
|
|
||||||
setdefaulttimeout(timeout)
|
setdefaulttimeout(timeout)
|
||||||
@ -370,7 +370,7 @@ def tryurl(fileurl, template):
|
|||||||
|
|
||||||
except urllib.error.URLError:
|
except urllib.error.URLError:
|
||||||
result = None
|
result = None
|
||||||
except IOError:
|
except OSError:
|
||||||
result = None
|
result = None
|
||||||
|
|
||||||
euscan.output.eend(errno.ENOENT if not result else 0)
|
euscan.output.eend(errno.ENOENT if not result else 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user