Guest User

Untitled

a guest
Jan 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. diff -r 31fc3ff3e626 pypy/objspace/std/test/test_unicodeobject.py
  2. --- a/pypy/objspace/std/test/test_unicodeobject.py Mon Sep 26 17:50:09 2011 -0400
  3. +++ b/pypy/objspace/std/test/test_unicodeobject.py Wed Sep 28 02:14:18 2011 -0400
  4. @@ -443,6 +443,7 @@
  5. assert u'<i><i><i>c' == u'abababc'.translate({ord('a'):None, ord('b'):u'<i>'})
  6. assert u'c' == u'abababc'.translate({ord('a'):None, ord('b'):u''})
  7. assert u'xyyx' == u'xzx'.translate({ord('z'):u'yy'})
  8. + assert u'abcd' == u'abcd'.translate(u'')
  9.  
  10. raises(TypeError, u'hello'.translate)
  11. raises(TypeError, u'abababc'.translate, {ord('a'):''})
  12. diff -r 31fc3ff3e626 pypy/objspace/std/unicodeobject.py
  13. --- a/pypy/objspace/std/unicodeobject.py Mon Sep 26 17:50:09 2011 -0400
  14. +++ b/pypy/objspace/std/unicodeobject.py Wed Sep 28 02:14:18 2011 -0400
  15. @@ -893,7 +893,7 @@
  16. try:
  17. w_newval = space.getitem(w_table, space.wrap(ord(unichar)))
  18. except OperationError, e:
  19. - if e.match(space, space.w_KeyError):
  20. + if e.match(space, space.w_KeyError) or e.match(space, space.w_IndexError):
  21. result.append(unichar)
  22. else:
  23. raise
Add Comment
Please, Sign In to add comment