Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: third_party/pexpect/tools/display-sighandlers.py

Issue 1398903002: Add third_party/pexpect (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@end-to-end-test
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Displays all signals, their values, and their handlers.
3 from __future__ import print_function
4 import signal
5 FMT = '{name:<10} {value:<5} {description}'
6
7 # header
8 print(FMT.format(name='name', value='value', description='description'))
9 print('-' * (33))
10
11 for name, value in [(signal_name, getattr(signal, signal_name))
12 for signal_name in dir(signal)
13 if signal_name.startswith('SIG')
14 and not signal_name.startswith('SIG_')]:
15 try:
16 handler = signal.getsignal(value)
17 except ValueError:
18 # FreeBSD: signal number out of range
19 handler = 'out of range'
20 description = {
21 signal.SIG_IGN: "ignored(SIG_IGN)",
22 signal.SIG_DFL: "default(SIG_DFL)"
23 }.get(handler, handler)
24 print(FMT.format(name=name, value=value, description=description))
OLDNEW
« no previous file with comments | « third_party/pexpect/tools/display-maxcanon.py ('k') | third_party/pexpect/tools/display-terminalinfo.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698