From 1f0559b0e74678b448d5ee76c8ff43575a9ea290 Mon Sep 17 00:00:00 2001 From: "Victor M. Alvarez" Date: Wed, 5 Mar 2014 12:14:32 +0100 Subject: [PATCH] Fix issue with test cases in Python 3 --- yara-python/tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yara-python/tests.py b/yara-python/tests.py index 4d3b66e346..13c4661161 100644 --- a/yara-python/tests.py +++ b/yara-python/tests.py @@ -412,7 +412,11 @@ def testHexStrings(self): rules = yara.compile(source='rule test { strings: $a = { 61 [0-3] (62|63) } condition: $a }') matches = rules.match(data='abbb') - self.assertTrue(matches[0].strings == [(0L, '$a', 'ab')]) + + if sys.version_info[0] >= 3: + self.assertTrue(matches[0].strings == [(0, '$a', bytes('ab', 'utf-8'))]) + else: + self.assertTrue(matches[0].strings == [(0, '$a', 'ab')]) def testCount(self):