[Reportbug-commits] [reportbug] 03/32: convert reportbug.hiermatch to py3k

Sandro Tosi morph at moszumanska.debian.org
Thu Dec 1 01:36:51 UTC 2016


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

morph pushed a commit to branch master
in repository reportbug.

commit c5314aede61b388b735e2b2c46a23909f735f768
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Jun 19 21:14:00 2016 +0100

    convert reportbug.hiermatch to py3k
---
 reportbug/hiermatch.py | 4 ++--
 test/test_hiermatch.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/reportbug/hiermatch.py b/reportbug/hiermatch.py
index 07d3a40..ebbec69 100644
--- a/reportbug/hiermatch.py
+++ b/reportbug/hiermatch.py
@@ -4,7 +4,7 @@
 #   Copyright (C) 2008-2016 Sandro Tosi <morph at 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)
diff --git a/test/test_hiermatch.py b/test/test_hiermatch.py
index 934afec..6834d51 100644
--- a/test/test_hiermatch.py
+++ b/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, '')

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



More information about the Reportbug-commits mailing list