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:
Alfred Wingate 2023-11-16 06:15:48 +02:00
parent 6c0b816e73
commit a03b420c75
No known key found for this signature in database
GPG Key ID: A12750536B5E7010
6 changed files with 7 additions and 7 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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)