Change in osmocom-bb[master]: trx_toolkit: cosmetic: get rid of 'i' where it is not used

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
Fri May 22 11:49:11 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/18397 )


Change subject: trx_toolkit: cosmetic: get rid of 'i' where it is not used
......................................................................

trx_toolkit: cosmetic: get rid of 'i' where it is not used

Change-Id: I00126a90446e5f3fb77a46be9d7d5dbff89fa221
---
M src/target/trx_toolkit/data_dump.py
M src/target/trx_toolkit/data_msg.py
M src/target/trx_toolkit/rand_burst_gen.py
M src/target/trx_toolkit/test_data_dump.py
4 files changed, 9 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/97/18397/1

diff --git a/src/target/trx_toolkit/data_dump.py b/src/target/trx_toolkit/data_dump.py
index 41af695..52768a9 100644
--- a/src/target/trx_toolkit/data_dump.py
+++ b/src/target/trx_toolkit/data_dump.py
@@ -98,7 +98,7 @@
 		self.f.seek(0)
 
 		# Read the capture in loop...
-		for i in range(idx):
+		for _ in range(idx):
 			# Attempt to read a message header
 			hdr_raw = self.f.read(self.HDR_LENGTH)
 			if len(hdr_raw) != self.HDR_LENGTH:
diff --git a/src/target/trx_toolkit/data_msg.py b/src/target/trx_toolkit/data_msg.py
index 35e09d6..55fb796 100644
--- a/src/target/trx_toolkit/data_msg.py
+++ b/src/target/trx_toolkit/data_msg.py
@@ -403,7 +403,7 @@
 
 	# Generate a random message specific burst
 	def rand_burst(self, length = GSM_BURST_LEN):
-		self.burst = [random.randint(0, 1) for i in range(length)]
+		self.burst = [random.randint(0, 1) for _ in range(length)]
 
 	# Transforms this message to TRX2L1 message
 	def gen_trx2l1(self, ver = None):
@@ -812,7 +812,7 @@
 		if length is None:
 			length = self.mod_type.bl
 
-		self.burst = [random.randint(-127, 127) for i in range(length)]
+		self.burst = [random.randint(-127, 127) for _ in range(length)]
 
 	# Transforms this message to L12TRX message
 	def gen_l12trx(self, ver = None):
diff --git a/src/target/trx_toolkit/rand_burst_gen.py b/src/target/trx_toolkit/rand_burst_gen.py
index a56467f..9ac6943 100644
--- a/src/target/trx_toolkit/rand_burst_gen.py
+++ b/src/target/trx_toolkit/rand_burst_gen.py
@@ -57,7 +57,7 @@
 		buf += [0] * 3
 
 		# Random data 1 / 2
-		buf += [random.randint(0, 1) for i in range(57)]
+		buf += [random.randint(0, 1) for _ in range(57)]
 
 		# Steal flag 1 / 2
 		buf.append(random.randint(0, 1))
@@ -71,7 +71,7 @@
 		buf.append(random.randint(0, 1))
 
 		# Random data 2 / 2
-		buf += [random.randint(0, 1) for i in range(57)]
+		buf += [random.randint(0, 1) for _ in range(57)]
 
 		# Tailing bits
 		buf += [0] * 3
@@ -90,7 +90,7 @@
 		buf += [0] * 3
 
 		# Random data 1 / 2
-		buf += [random.randint(0, 1) for i in range(39)]
+		buf += [random.randint(0, 1) for _ in range(39)]
 
 		# Training sequence
 		if tsc is None:
@@ -98,7 +98,7 @@
 		buf += tsc.seq
 
 		# Random data 2 / 2
-		buf += [random.randint(0, 1) for i in range(39)]
+		buf += [random.randint(0, 1) for _ in range(39)]
 
 		# Tailing bits
 		buf += [0] * 3
@@ -122,7 +122,7 @@
 		buf += tsc.seq
 
 		# Random data
-		buf += [random.randint(0, 1) for i in range(36)]
+		buf += [random.randint(0, 1) for _ in range(36)]
 
 		# Tailing bits
 		buf += [0] * 3
diff --git a/src/target/trx_toolkit/test_data_dump.py b/src/target/trx_toolkit/test_data_dump.py
index 5129196..9cd9b79 100644
--- a/src/target/trx_toolkit/test_data_dump.py
+++ b/src/target/trx_toolkit/test_data_dump.py
@@ -79,7 +79,7 @@
 	def _gen_rand_messages(self, cls, count, ver = 1):
 		msg_list = []
 
-		for i in range(count):
+		for _ in range(count):
 			msg = self._gen_rand_message(cls, ver)
 			msg_list.append(msg)
 

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I00126a90446e5f3fb77a46be9d7d5dbff89fa221
Gerrit-Change-Number: 18397
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200522/a4012760/attachment.htm>


More information about the gerrit-log mailing list