From: Martin Panter Date: Wed, 12 Feb 2014 00:09:01 +0000 (+0000) Subject: Use tuples with str.endswith(), supported since Python 2.5 X-Git-Tag: v0.23~16^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=133ac3fd610d96b8417efe62b7db2bd46fd85cfe;p=pyelftools.git Use tuples with str.endswith(), supported since Python 2.5 --- diff --git a/scripts/readelf.py b/scripts/readelf.py index 3263cfe..8179c01 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -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)