Commit 076fac37 authored by Stefan Behnel's avatar Stefan Behnel

simplify some code

parent 1d39c2ac
...@@ -225,13 +225,12 @@ class TestDebugTransform(DebuggerTestCase): ...@@ -225,13 +225,12 @@ class TestDebugTransform(DebuggerTestCase):
L = list(t.find('/Module/Globals')) L = list(t.find('/Module/Globals'))
# assertTrue is retarded, use the normal assert statement # assertTrue is retarded, use the normal assert statement
assert L assert L
xml_globals = dict( xml_globals = dict((e.attrib['name'], e.attrib['type']) for e in L)
[(e.attrib['name'], e.attrib['type']) for e in L])
self.assertEqual(len(L), len(xml_globals)) self.assertEqual(len(L), len(xml_globals))
L = list(t.find('/Module/Functions')) L = list(t.find('/Module/Functions'))
assert L assert L
xml_funcs = dict([(e.attrib['qualified_name'], e) for e in L]) xml_funcs = dict((e.attrib['qualified_name'], e) for e in L)
self.assertEqual(len(L), len(xml_funcs)) self.assertEqual(len(L), len(xml_funcs))
# test globals # test globals
...@@ -242,7 +241,7 @@ class TestDebugTransform(DebuggerTestCase): ...@@ -242,7 +241,7 @@ class TestDebugTransform(DebuggerTestCase):
funcnames = ('codefile.spam', 'codefile.ham', 'codefile.eggs', funcnames = ('codefile.spam', 'codefile.ham', 'codefile.eggs',
'codefile.closure', 'codefile.inner') 'codefile.closure', 'codefile.inner')
required_xml_attrs = 'name', 'cname', 'qualified_name' required_xml_attrs = 'name', 'cname', 'qualified_name'
assert all([f in xml_funcs for f in funcnames]) assert all(f in xml_funcs for f in funcnames)
spam, ham, eggs = [xml_funcs[funcname] for funcname in funcnames] spam, ham, eggs = [xml_funcs[funcname] for funcname in funcnames]
self.assertEqual(spam.attrib['name'], 'spam') self.assertEqual(spam.attrib['name'], 'spam')
......
...@@ -67,8 +67,8 @@ class Signature(object): ...@@ -67,8 +67,8 @@ class Signature(object):
# and are not looked up in here # and are not looked up in here
} }
type_to_format_map = dict([(type_, format_) type_to_format_map = dict(
for format_, type_ in format_map.iteritems()]) (type_, format_) for format_, type_ in format_map.iteritems())
error_value_map = { error_value_map = {
'O': "NULL", 'O': "NULL",
......
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