mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
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:
@@ -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'bö', (0, 0))
|
||||
assert repr(s) # Should not raise an Error!
|
||||
|
||||
Reference in New Issue
Block a user