Change in pysim[master]: [pylint] Fix float vs integer division in cards.py

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Sun May 2 00:56:51 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/24030 )


Change subject: [pylint] Fix float vs integer division in cards.py
......................................................................

[pylint] Fix float vs integer division in cards.py

Change-Id: Ie4ba72b725a56ba9cfe98cc7bd17dd3653194f36
---
M pySim/cards.py
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/30/24030/1

diff --git a/pySim/cards.py b/pySim/cards.py
index 24e789e..30857b3 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -517,7 +517,7 @@
 		r = self._scc.select_path(['3f00', '7f4d', f[0]])
 		rec_len = int(r[-1][28:30], 16)
 		tlen = int(r[-1][4:8],16)
-		rec_cnt = (tlen / rec_len) - 1
+		rec_cnt = (tlen // rec_len) - 1
 
 		if (rec_cnt < 1) or (rec_len != f[1]):
 			raise RuntimeError('Bad card type')
@@ -647,7 +647,7 @@
 		r = self._scc.select_path(['3f00', '000c'])
 		rec_len = int(r[-1][28:30], 16)
 		tlen = int(r[-1][4:8],16)
-		rec_cnt = (tlen / rec_len) - 1
+		rec_cnt = (tlen // rec_len) - 1
 
 		if (rec_cnt < 1) or (rec_len != 0x5a):
 			raise RuntimeError('Bad card type')

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/24030
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ie4ba72b725a56ba9cfe98cc7bd17dd3653194f36
Gerrit-Change-Number: 24030
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210502/7ee610b2/attachment.htm>


More information about the gerrit-log mailing list