Skip to content

Commit

Permalink
[testSupport] use repr() to stringify floats for py23 compat
Browse files Browse the repository at this point in the history
Part of fixing unified-font-object#19
  • Loading branch information
Cosimo Lupo committed Mar 17, 2016
1 parent 1867eb5 commit 6dbca7f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Lib/ufoLib/test/testSupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ def py(self):
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:
Expand Down Expand Up @@ -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))
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 6dbca7f

Please sign in to comment.