jenkins-bot submitted this change.
[IMPR] Code improvements
Change-Id: Ia47df5cfcaeb80ee5e1981ac3f049f9f27136004
---
M pywikibot/tools/threading.py
M scripts/create_isbn_edition.py
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/pywikibot/tools/threading.py b/pywikibot/tools/threading.py
index 8ef6c11..679bb37 100644
--- a/pywikibot/tools/threading.py
+++ b/pywikibot/tools/threading.py
@@ -6,13 +6,13 @@
#
from __future__ import annotations
-import concurrent.futures as futures
import dataclasses
import importlib
import queue
import re
import threading
import time
+from concurrent import futures
from typing import Any
import pywikibot # T306760
diff --git a/scripts/create_isbn_edition.py b/scripts/create_isbn_edition.py
index f000c03..77249ec 100755
--- a/scripts/create_isbn_edition.py
+++ b/scripts/create_isbn_edition.py
@@ -361,7 +361,7 @@
several implementation improvements
""" # noqa: E501, W505
#
-# (C) Pywikibot team, 2022-2024
+# (C) Pywikibot team, 2022-2025
#
# Distributed under the terms of the MIT license.
#
@@ -937,10 +937,9 @@
target[EDITIONLANGPROP] = lang_item.getID()
# Require short Wikipedia language code
- if len(booklang) > 3:
+ if len(booklang) > 3 and WIKILANGPROP in lang_item.claims:
# Get official language code
- if WIKILANGPROP in lang_item.claims:
- booklang = lang_item.claims[WIKILANGPROP][0].getTarget()
+ booklang = lang_item.claims[WIKILANGPROP][0].getTarget()
# Get edition title
edition_title = isbn_data['Title'].strip()
To view, visit change 1130655. To unsubscribe, or for help writing mail filters, visit settings.