Change in osmo-sim-auth[master]: card/SIM: use integer division

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Ludovic Rousseau gerrit-no-reply at lists.osmocom.org
Sun Oct 25 13:36:54 UTC 2020


Ludovic Rousseau has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sim-auth/+/20904 )


Change subject: card/SIM: use integer division
......................................................................

card/SIM: use integer division

    [(Data[18] & 0x80) / 0x80]\
TypeError: tuple indices must be integers or slices, not float

Change-Id: I38cafd941e230cbfc84a25d2317e90778d7e124f
---
M card/SIM.py
1 file changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sim-auth refs/changes/04/20904/1

diff --git a/card/SIM.py b/card/SIM.py
index e783747..78864a7 100644
--- a/card/SIM.py
+++ b/card/SIM.py
@@ -182,16 +182,16 @@
             fil['EF_num'] = Data[15]
             fil['codes_num'] = Data[16]
             fil['CHV1'] = ('not initialized','initialized')\
-                          [(Data[18] & 0x80) / 0x80]\
+                          [(Data[18] & 0x80) // 0x80]\
                         + ': %d attempts remain' % (Data[18] & 0x0F)
             fil['unblock_CHV1'] = ('not initialized','initialized')\
-                                  [(Data[19] & 0x80) / 0x80]\
+                                  [(Data[19] & 0x80) // 0x80]\
                                 + ': %d attempts remain' % (Data[19] & 0x0F)
             fil['CHV2'] = ('not initialized','initialized')\
-                          [(Data[20] & 0x80) / 0x80]\
+                          [(Data[20] & 0x80) // 0x80]\
                         + ': %d attempts remain' % (Data[20] & 0x0F)
             fil['unblock_CHV2'] = ('not initialized','initialized')\
-                                  [(Data[21] & 0x80) / 0x80]\
+                                  [(Data[21] & 0x80) // 0x80]\
                                 + ': %d attempts remain' % (Data[21] & 0x0F)
             if len(Data) > 23: 
                 fil['Adm'] = Data[23:]

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sim-auth/+/20904
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sim-auth
Gerrit-Branch: master
Gerrit-Change-Id: I38cafd941e230cbfc84a25d2317e90778d7e124f
Gerrit-Change-Number: 20904
Gerrit-PatchSet: 1
Gerrit-Owner: Ludovic Rousseau <ludovic.rousseau+osmocom at free.fr>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201025/1f8d7ce8/attachment.htm>


More information about the gerrit-log mailing list