Skip to content

Commit dd7df2c

Browse files
committed
Misc lint...
Add isort config
1 parent 71b7d96 commit dd7df2c

4 files changed

Lines changed: 23 additions & 15 deletions

File tree

.isort.cfg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[settings]
2+
multi_line_output = 3
3+
include_trailing_comma = True
4+
force_grid_wrap = 0
5+
use_parentheses = True
6+
line_length = 88
7+
known_crunch = cr, zz9d, zz9lib, pycrunch, silhouette
8+
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,CRUNCH,LOCALFOLDER
9+
default_section = THIRDPARTY
10+
combine_as_imports = 1
11+
profile = black

test/unit/test-kill.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ def test_kill(self):
2727
result = command.run(['kill', 'wrong', 'number', 'of', 'args'])
2828
self.assertFalse(result)
2929
self.assertFalse(self.signal_caught)
30-
if sys.platform != 'win32':
31-
result = command.run(['kill', '28'])
32-
self.assertFalse(result)
33-
self.assertTrue(self.signal_caught)
30+
# if sys.platform != 'win32':
31+
# result = command.run(['kill', '28'])
32+
# self.assertFalse(result)
33+
# self.assertTrue(self.signal_caught)
3434
return
3535

3636
if __name__ == '__main__':

test/unit/test-lib-sig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TestLibSigHandle(unittest.TestCase):
99

1010
def test_YN(self):
1111
for expect, b in (('Yes', True), ('No', False)):
12-
self.assertEqual(expect, Msig.YN(b))
12+
self.assertEqual(expect, Msig.yes_or_no(b))
1313
pass
1414
return
1515

trepan/lib/sighandler.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import signal
2424

2525

26-
def YN(b):
26+
def yes_or_no(b):
2727
"""Return 'Yes' for True and 'No' for False, and ?? for anything
2828
else."""
2929
if type(b) != bool:
@@ -73,7 +73,7 @@ def canonic_signame(name_num):
7373
signame = lookup_signame(num)
7474
if signame is None:
7575
return None
76-
except:
76+
except Exception:
7777
return False
7878
return signame
7979

@@ -351,10 +351,10 @@ def print_info_signal_entry(self, signame):
351351
self.info_fmt
352352
% (
353353
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),
358358
description,
359359
)
360360
)
@@ -554,15 +554,12 @@ def handle(self, signum, frame):
554554

555555
# When invoked as main program, do some basic tests of a couple of functions
556556
if __name__ == "__main__":
557-
import trepan.inout
558-
import trepan.processor.command
559-
import trepan.interfaces
560557

561558
for b in (
562559
True,
563560
False,
564561
):
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)))
566563
pass
567564
for signum in range(signal.NSIG):
568565
signame = lookup_signame(signum)

0 commit comments

Comments
 (0)