FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix surrogate test for Python 3.4 · Python-Repository-Hub/unidecode@c486776 · GitHub

Repository navigation

Commit c486776

Browse files
committed
Fix surrogate test for Python 3.4
1 parent 3521ac0 commit c486776

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎tests/test_unidecode.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def test_surrogate_pairs(self):
120120
s_sp_2 = _u('\udce3')
121121
s_sp = s_sp_1 + s_sp_2
122122

123-
self.assertEqual(s.encode('utf16'), s_sp.encode('utf16'))
123+
if sys.version_info < (3,4):
124+
self.assertEqual(s.encode('utf16'), s_sp.encode('utf16'))
125+
else:
126+
self.assertEqual(s.encode('utf16'), s_sp.encode('utf16', errors='surrogatepass'))
124127

125128
wlog = WarningLogger()
126129
wlog.start("Surrogate character")

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL