diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-02 10:53:33 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-02 10:53:33 +0100 |
commit | 47a17eee2201e7c878ed75cd67c3fdae13dbe8e3 (patch) | |
tree | 45b126a827d64b4565c241935df3ca4a77074d84 | |
parent | fb64c733945e719d8b5d3f5e467cb0c0b01a0fb0 (diff) | |
download | astroid-git-47a17eee2201e7c878ed75cd67c3fdae13dbe8e3.tar.gz |
reduce circular imports I: import exceptions directly
- rename exceptions module: it's exported to Pylint anyway
-rw-r--r-- | __init__.py | 2 | ||||
-rw-r--r-- | bases.py | 2 | ||||
-rw-r--r-- | builder.py | 2 | ||||
-rw-r--r-- | exceptions.py (renamed from _exceptions.py) | 0 | ||||
-rw-r--r-- | inference.py | 4 | ||||
-rw-r--r-- | inspector.py | 2 | ||||
-rw-r--r-- | manager.py | 2 | ||||
-rw-r--r-- | mixins.py | 3 | ||||
-rw-r--r-- | node_classes.py | 2 | ||||
-rw-r--r-- | protocols.py | 2 | ||||
-rw-r--r-- | rebuilder.py | 2 | ||||
-rw-r--r-- | scoped_nodes.py | 2 | ||||
-rw-r--r-- | utils.py | 2 |
13 files changed, 14 insertions, 13 deletions
diff --git a/__init__.py b/__init__.py index 840c53c6..62de81bb 100644 --- a/__init__.py +++ b/__init__.py @@ -60,7 +60,7 @@ __doctype__ = "restructuredtext en" # WARNING: internal imports order matters ! # make all exception classes accessible from astng package -from logilab.astng._exceptions import * +from logilab.astng.exceptions import * # make all node classes accessible from astng package from logilab.astng.nodes import * @@ -51,7 +51,7 @@ except ImportError: pass from logilab.common.compat import builtins -from logilab.astng._exceptions import InferenceError, ASTNGError, \ +from logilab.astng.exceptions import InferenceError, ASTNGError, \ NotFoundError, UnresolvableName from logilab.astng.as_string import as_string @@ -35,7 +35,7 @@ from inspect import isdatadescriptor from logilab.common.modutils import modpath_from_file -from logilab.astng._exceptions import ASTNGBuildingException, InferenceError +from logilab.astng.exceptions import ASTNGBuildingException, InferenceError from logilab.astng.raw_building import build_module, object_build_class, \ object_build_function, object_build_datadescriptor, attach_dummy_node, \ object_build_methoddescriptor, attach_const_node, attach_import_node diff --git a/_exceptions.py b/exceptions.py index 7dd6135e..7dd6135e 100644 --- a/_exceptions.py +++ b/exceptions.py diff --git a/inference.py b/inference.py index 597d450a..def91a03 100644 --- a/inference.py +++ b/inference.py @@ -34,8 +34,8 @@ except NameError: from logilab.astng import nodes, raw_building from logilab.astng.manager import ASTNGManager -from logilab.astng import ASTNGError, InferenceError, UnresolvableName, \ - NoDefault, NotFoundError, ASTNGBuildingException +from logilab.astng.exceptions import (ASTNGBuildingException, ASTNGError, + InferenceError, NoDefault, NotFoundError, UnresolvableName) from logilab.astng.bases import YES, Instance, InferenceContext, Generator, \ _infer_stmts, copy_context, path_wrapper, raise_if_nothing_infered from logilab.astng.protocols import _arguments_infer_argname diff --git a/inspector.py b/inspector.py index 181a3fa3..a4abd1f2 100644 --- a/inspector.py +++ b/inspector.py @@ -43,7 +43,7 @@ from logilab.common.modutils import get_module_part, is_relative, \ is_standard_module from logilab import astng -from logilab.astng import InferenceError +from logilab.astng.exceptions import InferenceError from logilab.astng.utils import LocalsVisitor class IdGeneratorMixIn: @@ -46,7 +46,7 @@ from logilab.common.modutils import NoSourceFile, is_python_source, \ get_module_files, get_source_file, zipimport from logilab.common.configuration import OptionsProviderMixIn -from logilab.astng._exceptions import ASTNGBuildingException +from logilab.astng.exceptions import ASTNGBuildingException def astng_wrapper(func, modname): """wrapper to give to ASTNGManager.project_from_files""" @@ -33,7 +33,8 @@ """ -from logilab.astng import ASTNGBuildingException, InferenceError, NotFoundError +from logilab.astng.exceptions import (ASTNGBuildingException, InferenceError, + NotFoundError) from logilab.astng.bases import BaseClass # /!\ We cannot build a StmtNode(NodeNG) class since modifying "__bases__" diff --git a/node_classes.py b/node_classes.py index c41cba00..26cac7ac 100644 --- a/node_classes.py +++ b/node_classes.py @@ -22,7 +22,7 @@ import sys -from logilab.astng import NoDefault +from logilab.astng.exceptions import NoDefault from logilab.astng.bases import NodeNG, BaseClass, Instance, copy_context, \ _infer_stmts, YES from logilab.astng.mixins import StmtMixIn, BlockRangeMixIn, AssignTypeMixin, \ diff --git a/protocols.py b/protocols.py index 301ef0fc..dba1834e 100644 --- a/protocols.py +++ b/protocols.py @@ -26,7 +26,7 @@ from __future__ import generators __doctype__ = "restructuredtext en" -from logilab.astng import InferenceError, NoDefault +from logilab.astng.exceptions import InferenceError, NoDefault from logilab.astng.node_classes import unpack_infer from logilab.astng.bases import copy_context, \ raise_if_nothing_infered, yes_if_nothing_infered, Instance, Generator, YES diff --git a/rebuilder.py b/rebuilder.py index 2d89af9c..9330711c 100644 --- a/rebuilder.py +++ b/rebuilder.py @@ -46,7 +46,7 @@ from _ast import (Expr as Discard, Str, Eq, Gt, GtE, In, Is, IsNot, Lt, LtE, NotEq, NotIn, ) -from logilab.astng import ASTNGBuildingException +from logilab.astng.exceptions import ASTNGBuildingException from logilab.astng import nodes as new diff --git a/scoped_nodes.py b/scoped_nodes.py index 64057318..336f0b1c 100644 --- a/scoped_nodes.py +++ b/scoped_nodes.py @@ -32,7 +32,7 @@ from itertools import chain from logilab.common.compat import builtins from logilab.common.decorators import cached -from logilab.astng import NotFoundError, NoDefault, \ +from logilab.astng.exceptions import NotFoundError, NoDefault, \ ASTNGBuildingException, InferenceError from logilab.astng.node_classes import Const, DelName, DelAttr, \ Dict, From, List, Name, Pass, Raise, Return, Tuple, Yield, \ @@ -36,7 +36,7 @@ extract information from it __docformat__ = "restructuredtext en" -from logilab.astng._exceptions import ASTNGBuildingException +from logilab.astng.exceptions import ASTNGBuildingException class ASTVisitor(object): """Abstract Base Class for Python AST Visitors. |