Use tuples with str.endswith(), supported since Python 2.5
authorMartin Panter <vadmium à gmail·com>
Wed, 12 Feb 2014 00:09:01 +0000 (00:09 +0000)
committerMartin Panter <vadmium à gmail·com>
Wed, 12 Feb 2014 00:09:01 +0000 (00:09 +0000)
scripts/readelf.py

index 3263cfe5c1e8ad60495faacdb6381718f9a077cc..8179c013a54cf5ca7a369c386bf3b571fd894823 100755 (executable)
@@ -350,11 +350,9 @@ class ReadElf(object):
                     parsed = 'Library runpath: [%s]' % bytes2str(tag.runpath)
                 elif tag.entry.d_tag == 'DT_SONAME':
                     parsed = 'Library soname: [%s]' % bytes2str(tag.soname)
-                elif (tag.entry.d_tag.endswith('SZ') or
-                      tag.entry.d_tag.endswith('ENT')):
+                elif tag.entry.d_tag.endswith(('SZ', 'ENT')):
                     parsed = '%i (bytes)' % tag['d_val']
-                elif (tag.entry.d_tag.endswith('NUM') or
-                      tag.entry.d_tag.endswith('COUNT')):
+                elif tag.entry.d_tag.endswith(('NUM', 'COUNT')):
                     parsed = '%i' % tag['d_val']
                 elif tag.entry.d_tag == 'DT_PLTREL':
                     s = describe_dyn_tag(tag.entry.d_val)