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
commit6999b05af2c2f3577c21768138f00e4d0e1cb762 (patch)
tree4c88e4c0a22d4baaac521c818ab69e3e387be290 /manager.py
parent9a7cc0159266d0ef9679c37cd5ac7926692f41e7 (diff)
downloadastroid-git-6999b05af2c2f3577c21768138f00e4d0e1cb762.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. --HG-- branch : rebuild
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 c31dd477..c001870a 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):