lists.arthurdejong.org
RSS feed

python-stdnum commit: r3 - python-stdnum/stdnum/isbn

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum commit: r3 - python-stdnum/stdnum/isbn



Author: arthur
Date: Fri Jul 23 16:34:31 2010
New Revision: 3
URL: http://arthurdejong.org/viewvc/python-stdnum?view=rev&revision=3

Log:
fix example and fix ISBN13 conversion

Modified:
   python-stdnum/stdnum/isbn/__init__.py

Modified: python-stdnum/stdnum/isbn/__init__.py
==============================================================================
--- python-stdnum/stdnum/isbn/__init__.py       Fri Jul 23 15:51:05 2010        
(r2)
+++ python-stdnum/stdnum/isbn/__init__.py       Fri Jul 23 16:34:31 2010        
(r3)
@@ -33,7 +33,7 @@
 >>> isbn_type('978-0-471-11709-4')
 'ISBN13'
 >>> to_isbn13('1-85798-218-5')
-'978-1-85798-218-X') ******************************************
+'978-1-85798-218-3'
 """
 
 
@@ -89,7 +89,7 @@
     if len(min_number) == 13:
         return number # nothing to do, already ISBN13
     # put new check digit in place
-    number = number[:-1] + _calc_isbn13_check_digit('978' + min_number)
+    number = number[:-1] + _calc_isbn13_check_digit('978' + min_number[:-1])
     # add prefix
     if ' ' in number:
         return '978 ' + number
--
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits