From d9a7cd1da64da57bea05e5b234b9d9c6fea7f911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sun, 11 Apr 2010 01:39:31 +0200 Subject: applied 2to3 and fixed the result --- portato/db/hash.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'portato/db/hash.py') diff --git a/portato/db/hash.py b/portato/db/hash.py index 4a6958b..f52f4dd 100644 --- a/portato/db/hash.py +++ b/portato/db/hash.py @@ -10,7 +10,7 @@ # # Written by René 'Necoro' Neumann -from __future__ import absolute_import, with_statement + import re from collections import defaultdict @@ -102,7 +102,7 @@ class HashDatabase (Database): if installed: cats = self.inst_cats else: - cats = self._db.iterkeys() + cats = iter(self._db.keys()) else: if installed: @@ -124,7 +124,7 @@ class HashDatabase (Database): except KeyError: # not in inst_cats - can be ignored pass - self._db[self.ALL] = filter(lambda x: x.cat != cat, self._db[self.ALL]) + self._db[self.ALL] = [x for x in self._db[self.ALL] if x.cat != cat] self.populate(cat+"/*") else: self.__initialize() @@ -148,7 +148,7 @@ class HashDatabase (Database): else: try: regex = re.compile(restrict, re.I) - except re.error, e: + except re.error as e: info(_("Error while compiling search expression: '%s'."), str(e)) else: # only set self._restrict if no error occurred self._restrict = regex -- cgit v1.2.3