jenkins-bot submitted this change.

View Change

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

Bug: T257399
Change-Id: Iec500bd2c068cdf701f2b16284118fe462c48e97
---
M scripts/upload.py
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/scripts/upload.py b/scripts/upload.py
index 3e77adc..7582005 100755
--- a/scripts/upload.py
+++ b/scripts/upload.py
@@ -55,8 +55,6 @@
#
# Distributed under the terms of the MIT license.
#
-from __future__ import absolute_import, division, unicode_literals
-
import codecs
import math
import os
@@ -71,7 +69,7 @@
r'-chunked(?::(\d+(?:\.\d+)?)[ \t]*(k|ki|m|mi)?b?)?$', re.I)


-def get_chunk_size(match):
+def get_chunk_size(match) -> int:
"""Get chunk size."""
if not match:
pywikibot.error('Chunk size parameter is not valid.')
@@ -96,7 +94,7 @@
return chunk_size


-def main(*args):
+def main(*args) -> None:
"""
Process command line arguments and invoke bot.

@@ -166,7 +164,7 @@
if description:
pywikibot.error('Both a description and a -descfile were '
'provided. Please specify only one of those.')
- return False
+ return
with codecs.open(description_file,
encoding=pywikibot.config.textfile_encoding) as f:
description = f.read().replace('\r\n', '\n')
@@ -199,7 +197,7 @@
'defined for all codes. ')
additional += 'Unable to run in -always mode'
suggest_help(missing_parameters=missing, additional_text=additional)
- return False
+ return

if os.path.isdir(url):
file_list = []

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Iec500bd2c068cdf701f2b16284118fe462c48e97
Gerrit-Change-Number: 611946
Gerrit-PatchSet: 2
Gerrit-Owner: JJMC89 <JJMC89.Wikimedia@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged