unicode strings should not raise an error if used in repr.

Python 2 doesn't allow unicode objects in __repr__ methods. Therefore we need to encode them as utf-8 bytes.
This commit is contained in:
Dave Halter
2015-03-25 23:39:53 +01:00
parent 4bb41b6096
commit 72fd190149
4 changed files with 30 additions and 15 deletions

View File

@@ -202,3 +202,8 @@ def test_param_splitting():
check('def x(a, (b, c)):\n pass', ['a'])
check('def x((b, c)):\n pass', [])
def test_unicode_string():
s = pt.String(None, u'', (0, 0))
assert repr(s) # Should not raise an Error!