Skip to content

Commit

Permalink
Do not use comparision with "is" for literals
Browse files Browse the repository at this point in the history
There is a warning with python 3.8 at fedora rawhide about
comparision with "is" while running ipa-server install.
See: https://bugs.python.org/issue34850

Signed-off-by: Tibor Dudlák <tdudlak@redhat.com>
  • Loading branch information
Tiboris committed Sep 11, 2019
1 parent a72e8ed commit b4a5338
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions yubico/yubikey_config.py
Expand Up @@ -475,12 +475,12 @@ def to_frame(self, slot=1):
"""
data = self.to_string()
payload = data.ljust(64, yubico_util.chr_byte(0x0))
if slot is 1:
if slot == 1:
if self._update_config:
command = SLOT.UPDATE1
else:
command = SLOT.CONFIG
elif slot is 2:
elif slot == 2:
if self._update_config:
command = SLOT.UPDATE2
else:
Expand Down
6 changes: 3 additions & 3 deletions yubico/yubikey_usb_hid.py
Expand Up @@ -285,13 +285,13 @@ def _waitfor(self, mode, mask, may_block, timeout=2):
seconds_left = min(20, seconds_left)
wait_num = (seconds_left * 2) - 1 + 6

if mode is 'nand':
if mode == 'nand':
if not flags & mask == mask:
finished = True
else:
self._debug("Status %s (0x%x) has not cleared bits %s (0x%x)\n"
% (bin(flags), flags, bin(mask), mask))
elif mode is 'and':
elif mode == 'and':
if flags & mask == mask:
finished = True
else:
Expand All @@ -303,7 +303,7 @@ def _waitfor(self, mode, mask, may_block, timeout=2):
if not finished:
wait_num -= 1
if wait_num == 0:
if mode is 'nand':
if mode == 'nand':
reason = 'Timed out waiting for YubiKey to clear status 0x%x' % mask
else:
reason = 'Timed out waiting for YubiKey to set status 0x%x' % mask
Expand Down

0 comments on commit b4a5338

Please sign in to comment.