jenkins-bot submitted this change.

View Change


Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Retrieve only one match

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

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 change 860501. To unsubscribe, or for help writing mail filters, visit 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 <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged