Skip to content

Commit 1f0559b

Browse files
committed
Fix issue with test cases in Python 3
1 parent 101b0a2 commit 1f0559b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

yara-python/tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,11 @@ def testHexStrings(self):
412412

413413
rules = yara.compile(source='rule test { strings: $a = { 61 [0-3] (62|63) } condition: $a }')
414414
matches = rules.match(data='abbb')
415-
self.assertTrue(matches[0].strings == [(0L, '$a', 'ab')])
415+
416+
if sys.version_info[0] >= 3:
417+
self.assertTrue(matches[0].strings == [(0, '$a', bytes('ab', 'utf-8'))])
418+
else:
419+
self.assertTrue(matches[0].strings == [(0, '$a', 'ab')])
416420

417421
def testCount(self):
418422

0 commit comments

Comments
 (0)