tests/test-linerange.py
branchstable
changeset 43366 ee3a55c8fd0f
parent 43076 2372284d9457
child 48875 6000f5b25c9b
--- a/tests/test-linerange.py	Fri Nov 01 17:35:36 2019 +0100
+++ b/tests/test-linerange.py	Fri Nov 01 17:31:47 2019 +0100
@@ -2,6 +2,7 @@
 
 import unittest
 from mercurial import error, mdiff
+from mercurial.utils import stringutil
 
 # for readability, line numbers are 0-origin
 text1 = b'''
@@ -228,7 +229,10 @@
             try:
                 mdiff.blocksinrange(self.blocks, linerange2)
             except exctype as exc:
-                self.assertTrue('line range exceeds file size' in str(exc))
+                self.assertTrue(
+                    b'line range exceeds file size'
+                    in stringutil.forcebytestr(exc)
+                )
             else:
                 self.fail('%s not raised' % exctype.__name__)