python-stdnum commit: r59 - python-stdnum/stdnum
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum commit: r59 - python-stdnum/stdnum
- From: Commits of the python-stdnum project <python-stdnum-commits [at] lists.arthurdejong.org>
- To: python-stdnum-commits [at] lists.arthurdejong.org
- Reply-to: python-stdnum-users [at] lists.arthurdejong.org
- Subject: python-stdnum commit: r59 - python-stdnum/stdnum
- Date: Sat, 5 Feb 2011 23:08:30 +0100 (CET)
Author: arthur
Date: Sat Feb 5 23:08:27 2011
New Revision: 59
URL: http://arthurdejong.org/viewvc/python-stdnum?view=rev&revision=59
Log:
move more validation into try/except (specifically the _convert() call)
Modified:
python-stdnum/stdnum/iban.py
Modified: python-stdnum/stdnum/iban.py
==============================================================================
--- python-stdnum/stdnum/iban.py Sat Feb 5 23:03:16 2011 (r58)
+++ python-stdnum/stdnum/iban.py Sat Feb 5 23:08:27 2011 (r59)
@@ -75,11 +75,11 @@
"""Checks to see if the number provided is a valid IBAN."""
try:
number = compact(number)
+ # ensure that checksum is valid
+ if not mod_97_10.is_valid(_convert(number)):
+ return False
except:
return False
- # ensure that checksum is valid
- if not mod_97_10.is_valid(_convert(number)):
- return False
# look up the number
info = _ibandb.info(number)
# check if the number has the correct structure
--
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits
- python-stdnum commit: r59 - python-stdnum/stdnum,
Commits of the python-stdnum project