From fe95d3f0b9dc82831db74bed9ed428583d113a63 Mon Sep 17 00:00:00 2001 From: zhouhao Date: Fri, 31 May 2024 13:38:01 +0800 Subject: [PATCH] Ignore the pylint warning of raising-bad-type and unbalanced-tuple-unpacking in connection and grabber script Change-Id: I051a3f3da0ddfa185a042d0116c660e2a87ad4e5 Signed-off-by: zhouhao --- mic/3rdparty/requests/packages/urllib3/util/connection.py | 2 +- mic/3rdparty/urlgrabber/grabber.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mic/3rdparty/requests/packages/urllib3/util/connection.py b/mic/3rdparty/requests/packages/urllib3/util/connection.py index 859aec6..8b2c725 100755 --- a/mic/3rdparty/requests/packages/urllib3/util/connection.py +++ b/mic/3rdparty/requests/packages/urllib3/util/connection.py @@ -85,7 +85,7 @@ def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, sock = None if err is not None: - raise err + raise err # pylint: disable=raising-bad-type else: raise socket.error("getaddrinfo returns an empty list") diff --git a/mic/3rdparty/urlgrabber/grabber.py b/mic/3rdparty/urlgrabber/grabber.py index d627249..e080b66 100755 --- a/mic/3rdparty/urlgrabber/grabber.py +++ b/mic/3rdparty/urlgrabber/grabber.py @@ -1165,13 +1165,13 @@ class URLGrabber(object): if (opts.retry is None) or (tries == opts.retry): if DEBUG: DEBUG.info('retries exceeded, re-raising') - raise exception + raise exception # pylint: disable=raising-bad-type retrycode = getattr(exception, 'errno', None) if (retrycode is not None) and (retrycode not in opts.retrycodes): if DEBUG: DEBUG.info('retrycode (%i) not in list %s, re-raising', retrycode, opts.retrycodes) - raise exception + raise exception # pylint: disable=raising-bad-type if retrycode is not None and retrycode < 0 and opts.retry_no_cache: opts.no_cache = True @@ -2561,7 +2561,7 @@ class _TH: ##################################################################### # TESTING def _main_test(): - try: url, filename = sys.argv[1:3] + try: url, filename = sys.argv[1:3] # pylint: disable=unbalanced-tuple-unpacking except ValueError: print('usage:', sys.argv[0], ' [copy_local=0|1] [close_connection=0|1]') @@ -2587,7 +2587,7 @@ def _main_test(): def _retry_test(): - try: url, filename = sys.argv[1:3] + try: url, filename = sys.argv[1:3] # pylint: disable=unbalanced-tuple-unpacking except ValueError: print('usage:', sys.argv[0], ' [copy_local=0|1] [close_connection=0|1]') -- 2.7.4