jenkins-bot has submitted this change and it was merged.
Change subject: Fix isbn.py -to13 operation when ISBN are already in this format
......................................................................
Fix isbn.py -to13 operation when ISBN are already in this format
Currently, the isbn.py -to13 operation doesn't support objects
already in ISBN 13 format.
To fix this issue, a toISBN13 method is added to the ISBN13 class.
Ideally this wouldn't be required but this allows to simplify code.
Bug: T138911
Change-Id: I755c8623486ed29a273891e17025b4b468273005
---
M scripts/isbn.py
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
Eranroz: Looks good to me, but someone else must approve
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/isbn.py b/scripts/isbn.py
index b96676c..7e83f9d 100755
--- a/scripts/isbn.py
+++ b/scripts/isbn.py
@@ -1466,7 +1466,11 @@
except InvalidIsbnException:
# don't change
return isbn
- i13 = getIsbn(isbn).toISBN13()
+ i1x = getIsbn(isbn)
+ if not isinstance(i1x, ISBN13):
+ i13 = i1x.toISBN13()
+ else:
+ i13 = i1x
return i13.code
--
To view, visit
https://gerrit.wikimedia.org/r/312726
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I755c8623486ed29a273891e17025b4b468273005
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Aadith1996 <96aadith(a)gmail.com>
Gerrit-Reviewer: Aadith1996 <96aadith(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Eranroz <eranroz89(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Whym <whym(a)whym.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>