From: Kefu Chai Date: Wed, 11 Apr 2018 14:41:01 +0000 (+0800) Subject: pybind/mgr/dashboard: silence lint warnings X-Git-Tag: v13.1.0~276^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c5a004d7c2f1bdd4738aeb3617e994b790d21dbf;p=ceph.git pybind/mgr/dashboard: silence lint warnings this silences following errors: 9: ./awsauth.py:42:1: E722 do not use bare except' 9: ./awsauth.py:116:13: E722 do not use bare except' Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/dashboard/awsauth.py b/src/pybind/mgr/dashboard/awsauth.py index 123d6282519..3fafcd75f4d 100644 --- a/src/pybind/mgr/dashboard/awsauth.py +++ b/src/pybind/mgr/dashboard/awsauth.py @@ -39,7 +39,7 @@ py3k = False try: from urlparse import urlparse, unquote from base64 import encodestring -except: +except ImportError: py3k = True from urllib.parse import urlparse, unquote from base64 import encodebytes as encodestring @@ -113,7 +113,7 @@ class S3Auth(AuthBase): lk = key.lower() try: lk = lk.decode('utf-8') - except: + except UnicodeDecodeError: pass if headers[key] and (lk in interesting_headers.keys() or lk.startswith('x-amz-')):