From a03b420c75bad5d98dabb646220146d45d4bd615 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Thu, 16 Nov 2023 06:15:48 +0200 Subject: [PATCH] Use OSError instead of alias IOError https://docs.astral.sh/ruff/rules/os-error-alias/ Signed-off-by: Alfred Wingate --- src/euscan/handlers/cpan.py | 2 +- src/euscan/handlers/generic.py | 2 +- src/euscan/handlers/php.py | 2 +- src/euscan/handlers/rubygems.py | 2 +- src/euscan/handlers/url.py | 2 +- src/euscan/helpers.py | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/euscan/handlers/cpan.py b/src/euscan/handlers/cpan.py index d88d355..43da2c2 100644 --- a/src/euscan/handlers/cpan.py +++ b/src/euscan/handlers/cpan.py @@ -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: diff --git a/src/euscan/handlers/generic.py b/src/euscan/handlers/generic.py index 1c4e445..25f2fb0 100644 --- a/src/euscan/handlers/generic.py +++ b/src/euscan/handlers/generic.py @@ -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: diff --git a/src/euscan/handlers/php.py b/src/euscan/handlers/php.py index 723595c..2516022 100644 --- a/src/euscan/handlers/php.py +++ b/src/euscan/handlers/php.py @@ -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: diff --git a/src/euscan/handlers/rubygems.py b/src/euscan/handlers/rubygems.py index 03e1c01..7cb26ce 100644 --- a/src/euscan/handlers/rubygems.py +++ b/src/euscan/handlers/rubygems.py @@ -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: diff --git a/src/euscan/handlers/url.py b/src/euscan/handlers/url.py index a856534..dd3e48a 100644 --- a/src/euscan/handlers/url.py +++ b/src/euscan/handlers/url.py @@ -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: diff --git a/src/euscan/helpers.py b/src/euscan/helpers.py index 3105069..b5cc791 100644 --- a/src/euscan/helpers.py +++ b/src/euscan/helpers.py @@ -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)