Bump flake8 version and handle new lint errors (#1385)

This commit is contained in:
Chris Tomlinson 2017-12-08 21:02:34 +00:00 committed by Terry Cain
parent 499857e67f
commit 279efc6b12
5 changed files with 11 additions and 11 deletions

View File

@ -111,16 +111,16 @@ class AWSCertificateManagerResponse(BaseResponse):
# actual data # actual data
try: try:
certificate = base64.standard_b64decode(certificate) certificate = base64.standard_b64decode(certificate)
except: except Exception:
return AWSValidationException('The certificate is not PEM-encoded or is not valid.').response() return AWSValidationException('The certificate is not PEM-encoded or is not valid.').response()
try: try:
private_key = base64.standard_b64decode(private_key) private_key = base64.standard_b64decode(private_key)
except: except Exception:
return AWSValidationException('The private key is not PEM-encoded or is not valid.').response() return AWSValidationException('The private key is not PEM-encoded or is not valid.').response()
if chain is not None: if chain is not None:
try: try:
chain = base64.standard_b64decode(chain) chain = base64.standard_b64decode(chain)
except: except Exception:
return AWSValidationException('The certificate chain is not PEM-encoded or is not valid.').response() return AWSValidationException('The certificate chain is not PEM-encoded or is not valid.').response()
try: try:

View File

@ -265,14 +265,14 @@ class LambdaFunction(BaseModel):
def convert(s): def convert(s):
try: try:
return str(s, encoding='utf-8') return str(s, encoding='utf-8')
except: except Exception:
return s return s
@staticmethod @staticmethod
def is_json(test_str): def is_json(test_str):
try: try:
response = json.loads(test_str) response = json.loads(test_str)
except: except Exception:
response = test_str response = test_str
return response return response

View File

@ -4,7 +4,7 @@ import json
try: try:
from urllib import unquote from urllib import unquote
except: except ImportError:
from urllib.parse import unquote from urllib.parse import unquote
from moto.core.utils import amz_crc32, amzn_request_id from moto.core.utils import amz_crc32, amzn_request_id

View File

@ -3,12 +3,12 @@ from six.moves.urllib.parse import urlparse
def bucket_name_from_url(url): def bucket_name_from_url(url):
pth = urlparse(url).path.lstrip("/") path = urlparse(url).path.lstrip("/")
l = pth.lstrip("/").split("/") parts = path.lstrip("/").split("/")
if len(l) == 0 or l[0] == "": if len(parts) == 0 or parts[0] == "":
return None return None
return l[0] return parts[0]
def parse_key_name(path): def parse_key_name(path):

View File

@ -3,7 +3,7 @@ mock
nose nose
sure==1.2.24 sure==1.2.24
coverage coverage
flake8==3.4.1 flake8==3.5.0
freezegun freezegun
flask flask
boto>=2.45.0 boto>=2.45.0