Cosmetic changes
authorEli Bendersky <eliben@gmail.com>
Wed, 26 Oct 2016 03:32:31 +0000 (20:32 -0700)
committerEli Bendersky <eliben@gmail.com>
Wed, 26 Oct 2016 03:32:31 +0000 (20:32 -0700)
elftools/dwarf/structs.py
elftools/elf/elffile.py
test/test_arm_support.py
test/test_dwarf_structs.py
test/test_elffile.py
test/test_utils.py

index bdd79da5f33a08188ca0833da2b31c44b2997c4f..562cccdcbe0504c183ac76a492e167baa3238603 100644 (file)
@@ -235,7 +235,7 @@ class DWARFStructs(object):
             self.Dwarf_uint16('version'),
             self.Dwarf_offset('header_length'),
             self.Dwarf_uint8('minimum_instruction_length'),
-            If(lambda ctx: ctx['version'] >= 4, 
+            If(lambda ctx: ctx['version'] >= 4,
                 self.Dwarf_uint8("maximum_operations_per_instruction"),
                 1),
             self.Dwarf_uint8('default_is_stmt'),
@@ -332,7 +332,6 @@ class _SLEB128Adapter(Adapter):
             value = (value << 7) + (ord(b) & 0x7F)
         if ord(obj[-1]) & 0x40:
             # negative -> sign extend
-            #
             value |= - (1 << (7 * len(obj)))
         return value
 
@@ -347,5 +346,3 @@ def _SLEB128(name):
     """ A construct creator for SLEB128 encoding.
     """
     return Rename(name, _SLEB128Adapter(_LEB128_reader()))
-
-
index 1cb0f4a532be316373b6638a6b84f0618bb55cb0..64fd479b55b09f0f4e80f259852540ab62768b0e 100644 (file)
@@ -223,7 +223,6 @@ class ELFFile(object):
         # Note: this code reads the stream directly, without using ELFStructs,
         # since we don't yet know its exact format. ELF was designed to be
         # read like this - its e_ident field is word-size and endian agnostic.
-        #
         self.stream.seek(0)
         magic = self.stream.read(4)
         elf_assert(magic == b'\x7fELF', 'Magic number does not match')
index 649366319f1e5c297e8cb3cb111defff3093dfa0..d31f2d1392ca56b709597a6ab65e6b9624f09561 100644 (file)
@@ -13,6 +13,7 @@ import os
 from utils import setup_syspath; setup_syspath()
 from elftools.elf.elffile import ELFFile
 
+
 class TestARMSupport(unittest.TestCase):
     def test_hello(self):
         with open(os.path.join('test', 'testfiles_for_unittests',
@@ -39,6 +40,6 @@ class TestARMSupport(unittest.TestCase):
             all_CUs = list(dwarfinfo.iter_CUs())
             self.assertEqual(len(all_CUs), 9)
 
+
 if __name__ == '__main__':
     unittest.main()
-
index bd4a8fc342dd9dfde59754b25d4d5f16ab57b9e7..777ff2c0363fb8f4e89ca0df3afadd0efbde944e 100644 (file)
@@ -31,7 +31,7 @@ class TestDWARFStructs(unittest.TestCase):
             # and another entry
             b'\x45\x50\x51\x00\x86\x12\x07\x08' +
             # followed by NULL
-            b'\x00')   
+            b'\x00')
         self.assertEqual(c.version, 2)
         self.assertEqual(c.opcode_base, 6)
         self.assertEqual(c.standard_opcode_lengths, [0, 1, 4, 8, 12])
@@ -44,4 +44,3 @@ class TestDWARFStructs(unittest.TestCase):
 
 if __name__ == '__main__':
     unittest.main()
-
index 5c7b2b8b44e9fdb459b3b61059389e74e45a1023..d7d9602348e6bb30efe10edea13ab4615ba6f13a 100644 (file)
@@ -12,6 +12,7 @@ except ImportError:
 from utils import setup_syspath; setup_syspath()
 from elftools.elf.elffile import ELFFile
 
+
 class TestMap(unittest.TestCase):
     def test_address_offsets(self):
         class MockELF(ELFFile):
index b74f2e51f83fff4728adcb546b06e4c24b9a83cc..5972b7d98b48731d3a12e718ae6df53f01174c9c 100644 (file)
@@ -60,6 +60,3 @@ class Test_preserve_stream_pos(unittest.TestCase):
 
 if __name__ == '__main__':
     unittest.main()
-
-
-