jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/688324 )
Change subject: [IMPR] use consecutive reference numbers for autogenerated links ......................................................................
[IMPR] use consecutive reference numbers for autogenerated links
currently free_number gives a randomized next free number for autogenerated links because set is not ordered. Use a generator instead.
Change-Id: I1d4489de77496579d77ff0cecf8550779454378b --- M scripts/reflinks.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: Rubin: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/reflinks.py b/scripts/reflinks.py index 2104cca..bb889be 100755 --- a/scripts/reflinks.py +++ b/scripts/reflinks.py @@ -350,9 +350,9 @@ with suppress(ValueError): used_numbers.add(int(number))
- # iterator to give the next free number - free_number = iter({str(i) for i in range(1, 1000) # should be enough - if i not in used_numbers}) + # generator to give the next free number + free_number = (str(i) for i in range(1, 1000) # should be enough + if i not in used_numbers)
for (g, d) in found_refs.items(): group = ''
pywikibot-commits@lists.wikimedia.org