jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860501 )

Change subject: Retrieve only one match
......................................................................

Retrieve only one match

Change-Id: I2e35bcc2e690d3fc0640dcf5e37928ef9d26087a
---
M scripts/checkimages.py
1 file changed, 12 insertions(+), 3 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 5eb5923..ae6d170 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -610,10 +610,10 @@
     def upload_bot_change_function(report_page_text, upload_bot_array) -> str:
         """Detect the user that has uploaded the file through upload bot."""
         regex = upload_bot_array[1]
-        results = re.findall(regex, report_page_text)
+        result = re.search(regex, report_page_text)

-        if results:
-            return results[0]
+        if result:
+            return result.group()

         # we can't find the user, report the problem to the bot
         return upload_bot_array[0]

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860501
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I2e35bcc2e690d3fc0640dcf5e37928ef9d26087a
Gerrit-Change-Number: 860501
Gerrit-PatchSet: 2
Gerrit-Owner: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to