summaryrefslogtreecommitdiff
path: root/manager.py
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-03-03 19:39:47 +0100
committerEmile Anclin <emile.anclin@logilab.fr>2010-03-03 19:39:47 +0100
commit58991d717e69b9478b661a1db2f5b0d5b1d9f87b (patch)
tree9e713199ffcaea7c567b8f2520070595be2134e5 /manager.py
parentd4bce458c1a4855d042b6aa930339808e5e3165b (diff)
downloadastroid-58991d717e69b9478b661a1db2f5b0d5b1d9f87b.tar.gz
remove infutils import in manager.py by adding a "instanciate_class" method.
We prepare this way a coming code rearrangement and avoid circular import. Remove "is_class_node" which was only used here.
Diffstat (limited to 'manager.py')
-rw-r--r--manager.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/manager.py b/manager.py
index c31dd47..c001870 100644
--- a/manager.py
+++ b/manager.py
@@ -33,7 +33,6 @@ from logilab.common.modutils import NoSourceFile, is_python_source, \
from logilab.common.configuration import OptionsProviderMixIn
from logilab.astng._exceptions import ASTNGBuildingException
-from logilab.astng import infutils
def astng_wrapper(func, modname):
"""wrapper to give to ASTNGManager.project_from_files"""
@@ -250,10 +249,12 @@ class ASTNGManager(OptionsProviderMixIn):
% (safe_repr(klass), ex))
# take care, on living object __module__ is regularly wrong :(
modastng = self.astng_from_module_name(modname)
- for infered in modastng.igetattr(name, context):
- if klass is not obj and infered.is_class_node:
- infered = infutils.Instance(infered)
- yield infered
+ if klass is obj:
+ for infered in modastng.igetattr(name, context):
+ yield infered
+ else:
+ for infered in modastng.igetattr(name, context):
+ yield infered.instanciate_class()
def project_from_files(self, files, func_wrapper=astng_wrapper,
project_name=None, black_list=None):