Commit 2c7cd1b4 authored by Stefan Behnel's avatar Stefan Behnel

fix some pylint findings

parent 4479bf15
......@@ -77,9 +77,8 @@ class TreeVisitor(object):
self.access_path = []
def dump_node(self, node, indent=0):
ignored = list(node.child_attrs or []) + [u'child_attrs', u'pos',
u'gil_message', u'cpp_message',
u'subexprs']
ignored = list(node.child_attrs or []) + [
u'child_attrs', u'pos', u'gil_message', u'cpp_message', u'subexprs']
values = []
pos = getattr(node, 'pos', None)
if pos:
......@@ -93,7 +92,7 @@ class TreeVisitor(object):
for attr in attribute_names:
if attr in ignored:
continue
if attr.startswith(u'_') or attr.endswith(u'_'):
if attr.startswith('_') or attr.endswith('_'):
continue
try:
value = getattr(node, attr)
......@@ -108,8 +107,7 @@ class TreeVisitor(object):
else:
value = repr(value)
values.append(u'%s = %s' % (attr, value))
return u'%s(%s)' % (node.__class__.__name__,
u',\n '.join(values))
return u'%s(%s)' % (node.__class__.__name__, u',\n '.join(values))
def _find_node_path(self, stacktrace):
import os.path
......@@ -129,7 +127,6 @@ class TreeVisitor(object):
return (last_traceback, nodes)
def _raise_compiler_error(self, child, e):
import sys
trace = ['']
for parent, attribute, index in self.access_path:
node = getattr(parent, attribute)
......@@ -389,7 +386,7 @@ class EnvTransform(CythonTransform):
def visit_CArgDeclNode(self, node):
# default arguments are evaluated in the outer scope
if node.default:
attrs = [ attr for attr in node.child_attrs if attr != 'default' ]
attrs = [attr for attr in node.child_attrs if attr != 'default']
self.visitchildren(node, attrs)
self.enter_scope(node, self.current_env().outer_scope)
self.visitchildren(node, ('default',))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment