jenkins-bot merged this change.

View Change

Approvals: Zhuyifei1999: Looks good to me, approved jenkins-bot: Verified
[IMPR] make Family.langs property more robust

Don't include closed wikis to family files with wikimedia_sites.py.

code is used as a local variable but assigning to cls.codes
may cause side effects and cls.codes could be be overwritten.
Use a copy of cls.codes instead.

Bug: T226934
Change-Id: I97e3ad1f9214e29927b4ed4d952a65eefcb68d10
---
M pywikibot/family.py
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pywikibot/family.py b/pywikibot/family.py
index 1ef3d45..27a1d64 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1568,7 +1568,7 @@
@classproperty
def langs(cls):
"""Property listing family languages."""
- codes = cls.codes
+ codes = cls.codes[:]

if hasattr(cls, 'test_codes'):
codes += cls.test_codes

To view, visit change 516273. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I97e3ad1f9214e29927b4ed4d952a65eefcb68d10
Gerrit-Change-Number: 516273
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Lokal Profil <andre.costa@wikimedia.se>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)