From 133ac3fd610d96b8417efe62b7db2bd46fd85cfe Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Wed, 12 Feb 2014 00:09:01 +0000 Subject: [PATCH] Use tuples with str.endswith(), supported since Python 2.5 --- scripts/readelf.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) -- 2.30.2