Skip to content

Commit

Permalink
CardType: fix PEP8 warnings
Browse files Browse the repository at this point in the history
CardType.py:73:17: E711 comparison to None should be 'if cond is None:'
CardType.py:93:17: E711 comparison to None should be 'if cond is not None:'
CardType.py:108:1: W391 blank line at end of file
  • Loading branch information
LudovicRousseau committed Nov 27, 2017
1 parent b1ecbf0 commit c8c1375
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions smartcard/CardType.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, atr, mask=None):
"""
self.atr = list(atr)
self.mask = mask
if None == mask:
if mask is None:
self.maskedatr = self.atr
else:
if len(self.atr) != len(self.mask):
Expand All @@ -90,7 +90,7 @@ def matches(self, atr, reader=None):
if len(atr) != len(self.atr):
return not True

if None != self.mask:
if self.mask is not None:
maskedatr = list(map(lambda x, y: x & y, list(atr), self.mask))
else:
maskedatr = atr
Expand All @@ -105,4 +105,3 @@ def matches(self, atr, reader=None):
connection.connect()
atrct = ATRCardType([0x3B, 0x16, 0x94, 0x20, 0x02, 0x01, 0x00, 0x00, 0x0D])
print(atrct.matches(connection.getATR()))

0 comments on commit c8c1375

Please sign in to comment.