Skip to content

Commit

Permalink
python3 sortby
Browse files Browse the repository at this point in the history
  • Loading branch information
dvklopfenstein committed Sep 16, 2018
1 parent cc1f5dd commit 34c1ed5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion goatools/rpt/write_hierarchy_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def prt_hier_rec(self, item_id, depth=1):
depth += 1
if self.max_indent is not None and depth > self.max_indent:
return
for child in sorted(obj.children, key=self.sortby):
children = obj.children if self.sortby is None else sorted(obj.children, key=self.sortby)
for child in children:
self.prt_hier_rec(child.item_id, depth)

def _prtfmt(self, item_id, dashes):
Expand Down
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ NOSETESTS := \
# Run all tests. If you are submitting a pull request, all tests must pass.
test:
py.test -v tests/
python3 -m pytest -v tests
make chk_parsers
# py.test tests/ --log-file=pytest.log

Expand Down

0 comments on commit 34c1ed5

Please sign in to comment.