Skip to content
Prev Previous commit
Next Next commit
Split _readmodule into two functions
  • Loading branch information
csabella committed Jul 1, 2017
commit 7105eedda0cdb0cee3cd3108fcda673817d4d800
5 changes: 5 additions & 0 deletions Lib/pyclbr.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ def _readmodule(module, path, inpackage=None):
return tree

fname = spec.loader.get_filename(fullmodule)
return _create_tree(fullmodule, path, fname, source, tree, inpackage)


def _create_tree(fullmodule, path, fname, source, tree, inpackage):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs docstring with explaination of parameters, which is needed to make direct call in test.

"Create the tree for each module."
f = io.StringIO(source)

stack = [] # stack of (class, indent) pairs
Expand Down