Change in ...osmocom-bb[master]: trx_toolkit: fix compatibility with Python 3: 'is' vs '=='

fixeria gerrit-no-reply at lists.osmocom.org
Tue Jul 23 22:44:33 UTC 2019


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


Change subject: trx_toolkit: fix compatibility with Python 3: 'is' vs '=='
......................................................................

trx_toolkit: fix compatibility with Python 3: 'is' vs '=='

Change-Id: I8ba05c04f206578cf61df58573c24cba1d6fba52
---
M src/target/trx_toolkit/burst_gen.py
M src/target/trx_toolkit/burst_send.py
M src/target/trx_toolkit/clck_gen.py
M src/target/trx_toolkit/ctrl_cmd.py
M src/target/trx_toolkit/fake_trx.py
5 files changed, 6 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/19/14919/1

diff --git a/src/target/trx_toolkit/burst_gen.py b/src/target/trx_toolkit/burst_gen.py
index 6db8219..5f39e6a 100755
--- a/src/target/trx_toolkit/burst_gen.py
+++ b/src/target/trx_toolkit/burst_gen.py
@@ -190,7 +190,7 @@
 
 	def sig_handler(self, signum, frame):
 		log.info("Signal %d received" % signum)
-		if signum is signal.SIGINT:
+		if signum == signal.SIGINT:
 			sys.exit(0)
 
 if __name__ == '__main__':
diff --git a/src/target/trx_toolkit/burst_send.py b/src/target/trx_toolkit/burst_send.py
index 2565f4a..368031c 100755
--- a/src/target/trx_toolkit/burst_send.py
+++ b/src/target/trx_toolkit/burst_send.py
@@ -149,7 +149,7 @@
 
 	def sig_handler(self, signum, frame):
 		log.info("Signal %d received" % signum)
-		if signum is signal.SIGINT:
+		if signum == signal.SIGINT:
 			sys.exit(0)
 
 if __name__ == '__main__':
diff --git a/src/target/trx_toolkit/clck_gen.py b/src/target/trx_toolkit/clck_gen.py
index 3e479e3..c58d8bd 100755
--- a/src/target/trx_toolkit/clck_gen.py
+++ b/src/target/trx_toolkit/clck_gen.py
@@ -111,7 +111,8 @@
 
 	def sig_handler(self, signum, frame):
 		log.info("Signal %d received" % signum)
-		if signum is signal.SIGINT:
+		if signum == signal.SIGINT:
+			print("Stopping timer")
 			self.clck.stop()
 
 if __name__ == '__main__':
diff --git a/src/target/trx_toolkit/ctrl_cmd.py b/src/target/trx_toolkit/ctrl_cmd.py
index 7deeeac..982cf31 100755
--- a/src/target/trx_toolkit/ctrl_cmd.py
+++ b/src/target/trx_toolkit/ctrl_cmd.py
@@ -114,7 +114,7 @@
 
 	def sig_handler(self, signum, frame):
 		log.info("Signal %d received" % signum)
-		if signum is signal.SIGINT:
+		if signum == signal.SIGINT:
 			sys.exit(0)
 
 if __name__ == '__main__':
diff --git a/src/target/trx_toolkit/fake_trx.py b/src/target/trx_toolkit/fake_trx.py
index ab90af4..8beee6e 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -496,7 +496,7 @@
 
 	def sig_handler(self, signum, frame):
 		log.info("Signal %d received" % signum)
-		if signum is signal.SIGINT:
+		if signum == signal.SIGINT:
 			self.shutdown()
 			sys.exit(0)
 

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I8ba05c04f206578cf61df58573c24cba1d6fba52
Gerrit-Change-Number: 14919
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/20190723/597758b3/attachment.html>


More information about the gerrit-log mailing list