Browse Source

convert reportbug.hiermatch to py3k

master
Sandro Tosi 6 years ago
parent
commit
c5314aede6
  1. 4
      reportbug/hiermatch.py
  2. 4
      test/test_hiermatch.py

4
reportbug/hiermatch.py

@ -4,7 +4,7 @@
# Copyright (C) 2008-2016 Sandro Tosi <morph@debian.org>
import re
import exceptions
from . import exceptions
def egrep_list(strlist, pattern_str, subindex=None):
@ -21,7 +21,7 @@ def egrep_list(strlist, pattern_str, subindex=None):
resultlist = []
if subindex is None:
subindex = range(len(strlist))
subindex = list(range(len(strlist)))
for i in subindex:
if pat.search(strlist[i]):
resultlist.append(i)

4
test/test_hiermatch.py

@ -1,4 +1,4 @@
import unittest2
import unittest
from reportbug import hiermatch, exceptions
@ -10,7 +10,7 @@ test_strings_list = ['Beautiful is better than ugly.',
'Sparse is better than dense.']
class TestHiermatch(unittest2.TestCase):
class TestHiermatch(unittest.TestCase):
def test_egrep_list(self):
res = hiermatch.egrep_list(None, '')

Loading…
Cancel
Save