[PATCH] osmocom-bb[fixeria/trx]: fake_trx/data_msg.py: fix python3 compatibility in tests

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 28 09:07:14 UTC 2018


Review at  https://gerrit.osmocom.org/6987

fake_trx/data_msg.py: fix python3 compatibility in tests

In Python3 a range has it's own type, so its comparasion with
a list is incorrect. Let's explicitly convert both bit ranges
to lists in the bit conversation tests.

Change-Id: I98c40d3d63cbcdc3e5dc840ebf8d7310c5c08e56
---
M src/target/fake_trx/data_msg.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/87/6987/1

diff --git a/src/target/fake_trx/data_msg.py b/src/target/fake_trx/data_msg.py
index aa264be..5ee8ed5 100644
--- a/src/target/fake_trx/data_msg.py
+++ b/src/target/fake_trx/data_msg.py
@@ -526,8 +526,8 @@
 	print("[?] Validate header randomization: OK")
 
 	# Bit conversation test
-	usbits_ref = range(0, 256)
-	sbits_ref = range(-127, 128)
+	usbits_ref = list(range(0, 256))
+	sbits_ref = list(range(-127, 128))
 
 	# Test both usbit2sbit() and sbit2usbit()
 	sbits = msg_trx2l1_ref.usbit2sbit(usbits_ref)

-- 
To view, visit https://gerrit.osmocom.org/6987
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I98c40d3d63cbcdc3e5dc840ebf8d7310c5c08e56
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list