From: david-sarah Date: Fri, 6 Aug 2010 04:16:16 +0000 (-0700) Subject: test_util.py: remove use of 'a if p else b' syntax that requires Python 2.5. X-Git-Tag: allmydata-tahoe-1.8.0b2~4 X-Git-Url: https://git.rkrishnan.org/simplejson/encoder.py.html?a=commitdiff_plain;h=8e90255349be4552da44e1960cc701d6c4c4ec88;p=tahoe-lafs%2Ftahoe-lafs.git test_util.py: remove use of 'a if p else b' syntax that requires Python 2.5. --- diff --git a/src/allmydata/test/test_util.py b/src/allmydata/test/test_util.py index 0b7b24f2..6b687808 100644 --- a/src/allmydata/test/test_util.py +++ b/src/allmydata/test/test_util.py @@ -2035,9 +2035,7 @@ class StringSpans(unittest.TestCase): return ds def dump(s): p = set(s._dump()) - # wow, this is the first time I've ever wanted ?: in python - # note: this requires python2.5 - d = "".join([(S[i] if i in p else " ") for i in range(l)]) + d = "".join([((i not in p) and " " or S[i]) for i in range(l)]) assert len(d) == l return d DEBUG = False