projects
/
platform
/
upstream
/
bcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a0dbcf
)
Fix python3 exception when ctrl-c tools/trace.py
author
Brenden Blanco
<bblanco@plumgrid.com>
Fri, 8 Apr 2016 22:52:55 +0000
(15:52 -0700)
committer
Brenden Blanco
<bblanco@plumgrid.com>
Sun, 10 Apr 2016 04:24:42 +0000
(21:24 -0700)
The way to do exception printing in python2/3 compatible way is using
sys.exc_info()[0/1].
tools/trace.py
patch
|
blob
|
history
diff --git
a/tools/trace.py
b/tools/trace.py
index
aca1b27
..
62d3143
100755
(executable)
--- a/
tools/trace.py
+++ b/
tools/trace.py
@@
-545,8
+545,8
@@
trace 'u:pthread:pthread_create (arg4 != 0)'
except:
if self.args.verbose:
traceback.print_exc()
- elif sys.exc_
type
is not SystemExit:
- print(sys.exc_
value
)
+ elif sys.exc_
info()[0]
is not SystemExit:
+ print(sys.exc_
info()[1]
)
self._close_probes()
if __name__ == "__main__":