From 3c17c8f7d579f6738b73f20c532a2f8498aec0d1 Mon Sep 17 00:00:00 2001 From: "Pieter J. Kersten" Date: Thu, 3 May 2012 12:28:10 +0200 Subject: [PATCH] [FIX] Typo in postcode handling --- account_banking/sepa/postalcode.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/account_banking/sepa/postalcode.py b/account_banking/sepa/postalcode.py index 087dee623..c97f08010 100644 --- a/account_banking/sepa/postalcode.py +++ b/account_banking/sepa/postalcode.py @@ -46,9 +46,7 @@ class PostalCode(object): ''' # Sort formats on length, longest first formats = [(len(x), x) for x in format.split('|')] - formats.sort() - formats.reverse() - formats = [x[1] for x in formats] + formats = [x[1] for x in sorted(formats, lambda x,y: -cmp(x,y))] self.res = [re.compile(x.replace('#', '\\d').replace('@','[A-Z]')) for x in formats ]