[Forensics-changes] [yara] 409/415: Fix issue with test cases in Python 3

Hilko Bengen bengen at moszumanska.debian.org
Thu Apr 3 05:43:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository yara.

commit 1f0559b0e74678b448d5ee76c8ff43575a9ea290
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Wed Mar 5 12:14:32 2014 +0100

    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 4d3b66e..13c4661 100644
--- a/yara-python/tests.py
+++ b/yara-python/tests.py
@@ -412,7 +412,11 @@ class TestYara(unittest.TestCase):
 
         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):
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list