From 6dbca7fa3855c6d92a9e960a0e0a25225c4ea8f2 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Thu, 17 Mar 2016 16:04:11 +0000 Subject: [PATCH] [testSupport] use repr() to stringify floats for py23 compat Part of fixing #19 --- Lib/ufoLib/test/testSupport.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/ufoLib/test/testSupport.py b/Lib/ufoLib/test/testSupport.py index 5ef9048ad..3bd29856f 100755 --- a/Lib/ufoLib/test/testSupport.py +++ b/Lib/ufoLib/test/testSupport.py @@ -101,9 +101,9 @@ class Glyph(object): if self.name is not None: text.append("glyph.name = \"%s\"" % self.name) if self.width: - text.append("glyph.width = %s" % str(self.width)) + text.append("glyph.width = %r" % self.width) if self.height: - text.append("glyph.height = %s" % str(self.height)) + text.append("glyph.height = %r" % self.height) if self.unicodes is not None: text.append("glyph.unicodes = [%s]" % ", ".join([str(i) for i in self.unicodes])) if self.note is not None: @@ -133,7 +133,7 @@ def _dictToString(d): elif isinstance(value, tuple): value = _tupleToString(value) elif isinstance(value, (int, float)): - value = str(value) + value = repr(value) elif isinstance(value, basestring): value = "\"%s\"" % value text.append("%s : %s" % (key, value)) @@ -151,7 +151,7 @@ def _listToString(l): elif isinstance(value, tuple): value = _tupleToString(value) elif isinstance(value, (int, float)): - value = str(value) + value = repr(value) elif isinstance(value, basestring): value = "\"%s\"" % value text.append(value) @@ -169,7 +169,7 @@ def _tupleToString(t): elif isinstance(value, tuple): value = _tupleToString(value) elif isinstance(value, (int, float)): - value = str(value) + value = repr(value) elif isinstance(value, basestring): value = "\"%s\"" % value text.append(value)