summaryrefslogtreecommitdiff
path: root/astroid/builder.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2016-12-18 13:32:19 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2016-12-18 13:32:19 +0200
commit1fd67174a0769c467108236362ba53d98753a06c (patch)
tree2b91e62e455a3b55d2b27720a075e0e12a563445 /astroid/builder.py
parent49c9dcfd103fdf28b37f686a14be755ed1ff1058 (diff)
downloadastroid-git-1fd67174a0769c467108236362ba53d98753a06c.tar.gz
Remove occurrences of no-else-return and consider-using-ternary
Diffstat (limited to 'astroid/builder.py')
-rw-r--r--astroid/builder.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/astroid/builder.py b/astroid/builder.py
index 5304aa95..ee3b7e25 100644
--- a/astroid/builder.py
+++ b/astroid/builder.py
@@ -192,7 +192,7 @@ class AstroidBuilder(raw_building.InspectBuilder):
modname = modname[:-9]
package = True
else:
- package = path and path.find('__init__.py') > -1 or False
+ package = path.find('__init__.py') > -1 if path else False
builder = rebuilder.TreeRebuilder(self._manager)
module = builder.visit_module(node, modname, node_file, package)
module._import_from_nodes = builder._import_from_nodes
@@ -411,8 +411,8 @@ def extract_node(code, module_name=''):
def _extract(node):
if isinstance(node, nodes.Expr):
return node.value
- else:
- return node
+
+ return node
requested_lines = []
for idx, line in enumerate(code.splitlines()):
@@ -434,5 +434,4 @@ def extract_node(code, module_name=''):
extracted = [_extract(node) for node in extracted]
if len(extracted) == 1:
return extracted[0]
- else:
- return extracted
+ return extracted