Closed Technologicat closed 5 years ago
...or maybe it's the fact I'm now trying to analyze a nontrivial __init__.py
? Debugging...
...which is in the cwd (see anutils.py
, function get_module_name
).
Yep, analyzing an __init__.py
in cwd was the actual culprit.
Let's document also the fact that nontrivial here means that the __init__.py
defines functions and/or classes, so something for Pyan to pick up.
The scope naming internals of objects at the top level of a module seem to have changed somewhere between Python 3.4 and 3.6.
This code used to work in Python 3.4 (
pyan/analyzer.py
, methodanalyze_scopes
):but in Python 3.6.8, I'm now getting names like
".some_top_level_object"
(note silly leading dot).Now
parent_ns
is empty, and the object name is returned insc.name
. It used to be the other way around.Seems this needs code to handle both cases...