summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshley Whetter <ashley@awhetter.co.uk>2018-05-05 16:52:07 -0700
committerAshley Whetter <ashley@awhetter.co.uk>2018-05-05 16:52:07 -0700
commit023dfc52c405fb095ce69b3a891e901093033d1b (patch)
treed5eec3daba336a7d5f852e7baa244b649527e8ca
parent228e34db1fdc4935df0d3d63f24e1e484dddf7e4 (diff)
downloadastroid-git-023dfc52c405fb095ce69b3a891e901093033d1b.tar.gz
Fix lint errors
-rw-r--r--astroid/decorators.py4
-rw-r--r--astroid/inference.py12
-rw-r--r--astroid/protocols.py4
-rw-r--r--astroid/scoped_nodes.py4
4 files changed, 13 insertions, 11 deletions
diff --git a/astroid/decorators.py b/astroid/decorators.py
index a0625f2c..a8a92ef3 100644
--- a/astroid/decorators.py
+++ b/astroid/decorators.py
@@ -80,7 +80,7 @@ def path_wrapper(func):
if context is None:
context = contextmod.InferenceContext()
if context.push(node):
- return
+ return None
yielded = set()
generator = _func(node, context, **kwargs)
@@ -100,7 +100,7 @@ def path_wrapper(func):
# comment in raise_if_nothing_inferred.
if error.args:
return error.args[0]
- return
+ return None
return wrapped
diff --git a/astroid/inference.py b/astroid/inference.py
index 5467736e..8c862ee9 100644
--- a/astroid/inference.py
+++ b/astroid/inference.py
@@ -327,18 +327,18 @@ def infer_subscript(self, context=None):
try:
value = next(self.value.infer(context))
except StopIteration:
- return
+ return None
if value is util.Uninferable:
yield util.Uninferable
- return
+ return None
try:
index = next(self.slice.infer(context))
except StopIteration:
- return
+ return None
if index is util.Uninferable:
yield util.Uninferable
- return
+ return None
# Try to deduce the index value.
index_value = _SUBSCRIPT_SENTINEL
@@ -367,7 +367,7 @@ def infer_subscript(self, context=None):
# is the same as the original subscripted object.
if self is assigned or assigned is util.Uninferable:
yield util.Uninferable
- return
+ return None
for inferred in assigned.infer(context):
yield inferred
@@ -398,7 +398,7 @@ def _infer_boolop(self, context=None):
values = [value.infer(context=context) for value in values]
except exceptions.InferenceError:
yield util.Uninferable
- return
+ return None
for pair in itertools.product(*values):
if any(item is util.Uninferable for item in pair):
diff --git a/astroid/protocols.py b/astroid/protocols.py
index 7ae93976..641605c5 100644
--- a/astroid/protocols.py
+++ b/astroid/protocols.py
@@ -354,7 +354,7 @@ nodes.Arguments.assigned_stmts = arguments_assigned_stmts
def assign_assigned_stmts(self, node=None, context=None, asspath=None):
if not asspath:
yield self.value
- return
+ return None
for inferred in _resolve_asspart(self.value.infer(context), asspath, context):
yield inferred
# Explicit StopIteration to return error information, see comment
@@ -503,7 +503,7 @@ def with_assigned_stmts(self, node=None, context=None, asspath=None):
try:
mgr = next(mgr for (mgr, vars) in self.items if vars == node)
except StopIteration:
- return
+ return None
if asspath is None:
for result in _infer_context_manager(self, mgr, context):
yield result
diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py
index 0c8b6476..99a275c9 100644
--- a/astroid/scoped_nodes.py
+++ b/astroid/scoped_nodes.py
@@ -2511,7 +2511,7 @@ class ClassDef(mixins.FilterStmtsMixin, LocalsDictNodeNG,
def _islots(self):
""" Return an iterator with the inferred slots. """
if '__slots__' not in self.locals:
- return
+ return None
for slots in self.igetattr('__slots__'):
# check if __slots__ is a valid type
for meth in ITER_METHODS:
@@ -2558,6 +2558,8 @@ class ClassDef(mixins.FilterStmtsMixin, LocalsDictNodeNG,
except exceptions.InferenceError:
continue
+ return None
+
def _slots(self):
if not self.newstyle:
raise NotImplementedError(