diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-10-21 11:44:26 +0200 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-10-21 11:44:26 +0200 |
commit | 6d59ad07d722d01e458aaf8fd14fd7dfc7ebaa6e (patch) | |
tree | 2dd9b9a68192d8bfaca12402967de897ee3fb5a7 /mixins.py | |
parent | 75d0203dcaab646aa73afdb1646425b4cbe3bc1a (diff) | |
download | astroid-git-6d59ad07d722d01e458aaf8fd14fd7dfc7ebaa6e.tar.gz |
fix Module.getattr and rename "absolute_modname" to "relative_to_absolute_name"
This renaming is done because there is actually no simple way to know if we
are on an absolute import or on an implicit relative import.
And the "absolute_import_activated" killed
the relative import we just wanted in case of "relative_only" option.
Diffstat (limited to 'mixins.py')
-rw-r--r-- | mixins.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -139,7 +139,9 @@ class FromImportMixIn(BaseClass, FilterStmtsMixin): # XXX: no more needed ? mymodule = self.root() level = getattr(self, 'level', None) # Import as no level - if mymodule.absolute_modname(modname, level) == mymodule.name: + # XXX we should investigate deeper if we really want to check + # importing itself: modname and mymodule.name be relative or absolute + if mymodule.relative_to_absolute_name(modname, level) == mymodule.name: # FIXME: I don't know what to do here... raise InferenceError('module importing itself: %s' % modname) try: |