|
23 | 23 | import signal |
24 | 24 |
|
25 | 25 |
|
26 | | -def YN(b): |
| 26 | +def yes_or_no(b): |
27 | 27 | """Return 'Yes' for True and 'No' for False, and ?? for anything |
28 | 28 | else.""" |
29 | 29 | if type(b) != bool: |
@@ -73,7 +73,7 @@ def canonic_signame(name_num): |
73 | 73 | signame = lookup_signame(num) |
74 | 74 | if signame is None: |
75 | 75 | return None |
76 | | - except: |
| 76 | + except Exception: |
77 | 77 | return False |
78 | 78 | return signame |
79 | 79 |
|
@@ -351,10 +351,10 @@ def print_info_signal_entry(self, signame): |
351 | 351 | self.info_fmt |
352 | 352 | % ( |
353 | 353 | signame, |
354 | | - YN(sig_obj.b_stop), |
355 | | - YN(sig_obj.print_method is not None), |
356 | | - YN(sig_obj.print_stack), |
357 | | - YN(sig_obj.pass_along), |
| 354 | + yes_or_no(sig_obj.b_stop), |
| 355 | + yes_or_no(sig_obj.print_method is not None), |
| 356 | + yes_or_no(sig_obj.print_stack), |
| 357 | + yes_or_no(sig_obj.pass_along), |
358 | 358 | description, |
359 | 359 | ) |
360 | 360 | ) |
@@ -554,15 +554,12 @@ def handle(self, signum, frame): |
554 | 554 |
|
555 | 555 | # When invoked as main program, do some basic tests of a couple of functions |
556 | 556 | if __name__ == "__main__": |
557 | | - import trepan.inout |
558 | | - import trepan.processor.command |
559 | | - import trepan.interfaces |
560 | 557 |
|
561 | 558 | for b in ( |
562 | 559 | True, |
563 | 560 | False, |
564 | 561 | ): |
565 | | - print("YN of %s is %s" % (repr(b), YN(b))) |
| 562 | + print("yes_or_no of %s is %s" % (repr(b), yes_or_no(b))) |
566 | 563 | pass |
567 | 564 | for signum in range(signal.NSIG): |
568 | 565 | signame = lookup_signame(signum) |
|
0 commit comments