Skip to content

Commit

Permalink
Fix issue with test cases in Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Mar 5, 2014
1 parent 101b0a2 commit 1f0559b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion yara-python/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down

0 comments on commit 1f0559b

Please sign in to comment.