summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-07-24 05:40:37 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-07-24 05:44:19 +0700
commit88e16205023c1ee2e590639d633f2361cf916f8a (patch)
tree8ab28422a508dd9e86cf26b7a95a80cdefc66a92 /src
parentd206f0cc2fd13f636a9ae8399bbe57c5622b03f7 (diff)
trx_toolkit: fix compatibility with Python 3: 'is' vs '=='
Diffstat (limited to 'src')
-rwxr-xr-xsrc/target/trx_toolkit/burst_gen.py2
-rwxr-xr-xsrc/target/trx_toolkit/burst_send.py2
-rwxr-xr-xsrc/target/trx_toolkit/clck_gen.py3
-rwxr-xr-xsrc/target/trx_toolkit/ctrl_cmd.py2
-rwxr-xr-xsrc/target/trx_toolkit/fake_trx.py2
5 files changed, 6 insertions, 5 deletions
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 @@ class Application(ApplicationBase):
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 @@ class Application(ApplicationBase):
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 @@ class Application(ApplicationBase):
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 @@ class Application(ApplicationBase):
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 @@ class Application(ApplicationBase):
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)