py3: fix exception message check in test-linerange.py's testOutOfRange
Differential Revision: https://phab.mercurial-scm.org/D7192
--- 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__)