Skip to content

Commit b28a10c

Browse files
committed
Fix some left-over peculiarities
1 parent 6f1ac2f commit b28a10c

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎OMMClient/OMDevice.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __getattr__(self, item):
6363
return self.__dict__[item.name]
6464

6565
def __setattr__(self, key, value):
66-
if key is "ppn" and "ppn" in self.__dict__:
66+
if key == "ppn" and "ppn" in self.__dict__:
6767
raise Exception("Cannot change ppn !")
6868
with self._changelock:
6969
self._changes[key] = value

‎OMMClient/OMUser.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __getattr__(self, item):
9898
return self.__dict__[item]
9999

100100
def __setattr__(self, key, value):
101-
if key is "uid" and "uid" in self.__dict__:
101+
if key == "uid" and "uid" in self.__dict__:
102102
raise Exception("Cannot change uid !")
103103
with self._changelock:
104104
self._changes[key] = value
@@ -116,8 +116,9 @@ def get_attributes(self):
116116
return attributes
117117

118118
def commit(self):
119-
if len(self._changes) == 0:
119+
if not self._changes:
120120
return True
121121
with self._changelock:
122122
for change in self._changes:
123123
print(change)
124+
return True

‎OMMClient/utils.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def encrypt_pin(pin, modulus, exponent):
1313

1414

1515
def convert_ipui(ipui):
16-
if len(ipui) is not 10:
16+
if len(ipui) != 10:
1717
return False
1818
emcHex = ipui[:5]
1919
psnHex = ipui[-5:]
@@ -26,6 +26,6 @@ def convert_ipui(ipui):
2626
chksum += int(c) * m
2727
m += 1
2828
chkdgt = chksum % 11
29-
if chkdgt is 10:
29+
if chkdgt == 10:
3030
chkdgt = '*'
3131
return '%s%s%s' % (emc, psn, chkdgt)

0 commit comments

Comments
 (0)