summaryrefslogtreecommitdiff
path: root/astroid/helpers.py
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-08-09 02:06:38 +0300
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-08-09 02:06:38 +0300
commitfa14393e7798d09fb9cca9c286c0626d18d41d2b (patch)
treea808a68fc2577e310536ca16b8e9e351a47d439d /astroid/helpers.py
parentbea1d4b8644dbdc93fa72b5333e8282936e801ab (diff)
downloadastroid-fa14393e7798d09fb9cca9c286c0626d18d41d2b.tar.gz
Move YES to astroid.util.
YES is needed by other components of astroid, components which aren't necessarily related to astroid.bases. In order to reduce circular interdependencies between components, YES is moved into a new module, tailored for various *utilities*.
Diffstat (limited to 'astroid/helpers.py')
-rw-r--r--astroid/helpers.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/astroid/helpers.py b/astroid/helpers.py
index 1148ada..21dd76c 100644
--- a/astroid/helpers.py
+++ b/astroid/helpers.py
@@ -27,6 +27,7 @@ from astroid import exceptions
from astroid import manager
from astroid import raw_building
from astroid import scoped_nodes
+from astroid import util
BUILTINS = six.moves.builtins.__name__
@@ -89,9 +90,9 @@ def object_type(node, context=None):
try:
types = set(_object_type(node, context))
except exceptions.InferenceError:
- return bases.YES
+ return util.YES
if len(types) > 1 or not types:
- return bases.YES
+ return util.YES
return list(types)[0]
@@ -135,7 +136,7 @@ def has_known_bases(klass, context=None):
def _type_check(type1, type2):
if not all(map(has_known_bases, (type1, type2))):
- return bases.YES
+ return util.YES
if not all([type1.newstyle, type2.newstyle]):
return False
@@ -143,7 +144,7 @@ def _type_check(type1, type2):
return type1 in type2.mro()[:-1]
except exceptions.MroError:
# The MRO is invalid.
- return bases.YES
+ return util.YES
def is_subtype(type1, type2):