Change in pysim[master]: cards: Python 3 fix: use the floor division operator //

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed Feb 26 19:21:04 UTC 2020


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/17281 )


Change subject: cards: Python 3 fix: use the floor division operator //
......................................................................

cards: Python 3 fix: use the floor division operator //

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



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/81/17281/1

diff --git a/pySim/cards.py b/pySim/cards.py
index 053ea98..ec2724c 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -77,10 +77,10 @@
 		"""
 		# get size and write EF.HPLMNwAcT
 		data = self._scc.read_binary(EF['HPLMNwAcT'], length=None, offset=0)
-		size = len(data[0])/2
+		size = len(data[0]) // 2
 		hplmn = enc_plmn(mcc, mnc)
 		content = hplmn + access_tech
-		data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size/5-1))
+		data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size // 5 - 1))
 		return sw
 
 	def update_oplmn_act(self, mcc, mnc, access_tech='FFFF'):
@@ -92,7 +92,7 @@
 		size = len(data[0]) // 2
 		hplmn = enc_plmn(mcc, mnc)
 		content = hplmn + access_tech
-		data, sw = self._scc.update_binary(EF['OPLMNwAcT'], content + 'ffffff0000' * (size/5-1))
+		data, sw = self._scc.update_binary(EF['OPLMNwAcT'], content + 'ffffff0000' * (size // 5 - 1))
 		return sw
 
 	def update_plmn_act(self, mcc, mnc, access_tech='FFFF'):
@@ -104,7 +104,7 @@
 		size = len(data[0]) // 2
 		hplmn = enc_plmn(mcc, mnc)
 		content = hplmn + access_tech
-		data, sw = self._scc.update_binary(EF['PLMNwAcT'], content + 'ffffff0000' * (size/5-1))
+		data, sw = self._scc.update_binary(EF['PLMNwAcT'], content + 'ffffff0000' * (size // 5 - 1))
 		return sw
 
 	def update_plmnsel(self, mcc, mnc):

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I21de34133dbc5d859a5b744adc74f706ba2f0dd8
Gerrit-Change-Number: 17281
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200226/0278384e/attachment.htm>


More information about the gerrit-log mailing list