From: Raphael Michel Date: Thu, 29 Nov 2018 17:45:21 +0000 (+0100) Subject: Fix bugs found by linter X-Git-Tag: v2.0.0~1^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37b7bd900065d05ec31667354718cd3bd9e42174;p=thirdparty%2Fpython-fints.git Fix bugs found by linter --- diff --git a/fints/client.py b/fints/client.py index 21d8893..0e0ebc4 100644 --- a/fints/client.py +++ b/fints/client.py @@ -315,7 +315,7 @@ class FinTS3Client: def _log_response(self, segment, response): if response.code[0] in ('0', '1'): log_target = logger.info - elif response.code[0] in ('3'): + elif response.code[0] in ('3',): log_target = logger.warning else: log_target = logger.error @@ -947,7 +947,7 @@ class NeedTANResponse(NeedRetryResponse): self.challenge_html = bleach.clean( self.challenge, tags=['br', 'p', 'b', 'i', 'u', 'ul', 'ol', 'li'], - attributes=[], + attributes={}, ) else: self.challenge_html = bleach.clean(self.challenge, tags=[]) @@ -1040,8 +1040,8 @@ class FinTS3PinTanClient(FinTS3Client): if tan_process == '1': seg.segment_type = orig_seg.header.type account_ = getattr(orig_seg, 'account', None) - if isinstance(account, KTI1): - seg.account = account + if isinstance(account_, KTI1): + seg.account = account_ raise NotImplementedError("TAN-Process 1 not implemented") if tan_process in ('1', '3', '4') and \ diff --git a/fints/dialog.py b/fints/dialog.py index eef17fd..ef43fdf 100644 --- a/fints/dialog.py +++ b/fints/dialog.py @@ -18,11 +18,11 @@ DATA_BLOB_MAGIC = b'python-fints_DIALOG_DATABLOB' class FinTSDialog: - def __init__(self, client=None, lazy_init=False, enc_mechanism=None, auth_mechanisms=[]): + def __init__(self, client=None, lazy_init=False, enc_mechanism=None, auth_mechanisms=None): self.client = client - self.next_message_number = dict((v, 1) for v in MessageDirection) + self.next_message_number = dict((v, 1) for v in MessageDirection) self.messages = dict((v, {}) for v in MessageDirection) - self.auth_mechanisms = auth_mechanisms + self.auth_mechanisms = auth_mechanisms or [] self.enc_mechanism = enc_mechanism self.open = False self.need_init = True