From 750e122d2bcdf05e600112ffda431f97608db387 Mon Sep 17 00:00:00 2001 From: Daniel Elstner Date: Tue, 15 Sep 2015 11:42:05 +0200 Subject: jitter, pwm: Avoid Unicode string literals It seems the Python we ship along our Windows binaries does not support u"..." strings, even though it's been a language feature since Python 2. Remove the "u" prefix to avoid a syntax error. Also, consistently use format "%.1f" at all scales. This fixes bug #569. --- decoders/pwm/pd.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'decoders/pwm/pd.py') diff --git a/decoders/pwm/pd.py b/decoders/pwm/pd.py index 45e96e2..e0203a3 100644 --- a/decoders/pwm/pd.py +++ b/decoders/pwm/pd.py @@ -77,17 +77,17 @@ class Decoder(srd.Decoder): def putp(self, period_t): # Adjust granularity. if period_t == 0 or period_t >= 1: - period_s = u'%u s' % (period_t) + period_s = '%.1f s' % (period_t) elif period_t <= 1e-12: - period_s = u'%.1f fs' % (period_t * 1e15) + period_s = '%.1f fs' % (period_t * 1e15) elif period_t <= 1e-9: - period_s = u'%.1f ps' % (period_t * 1e12) + period_s = '%.1f ps' % (period_t * 1e12) elif period_t <= 1e-6: - period_s = u'%.1f ns' % (period_t * 1e9) + period_s = '%.1f ns' % (period_t * 1e9) elif period_t <= 1e-3: - period_s = u'%.1f μs' % (period_t * 1e6) + period_s = '%.1f μs' % (period_t * 1e6) else: - period_s = u'%.1f ms' % (period_t * 1e3) + period_s = '%.1f ms' % (period_t * 1e3) self.put(self.ss, self.es, self.out_ann, [1, [period_s]]) -- cgit v1.2.3-70-g09d2