jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743360 )
Change subject: [W1510] Don't ignore non-zero exit with subprocess.run() ......................................................................
[W1510] Don't ignore non-zero exit with subprocess.run()
raise an exception instead which is intentional by default. https://deepsource.io/gh/ZabeMath/pywikibot/issue/PYL-W1510/occurrences
Change-Id: Ia6c3ae37085244cb0131b2b23348f227b513baa4 --- M pywikibot/editor.py M scripts/shell.py 2 files changed, 3 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/editor.py b/pywikibot/editor.py index db627e1..e40be73 100644 --- a/pywikibot/editor.py +++ b/pywikibot/editor.py @@ -95,7 +95,7 @@ tempFile.write(text) creationDate = os.stat(tempFilename).st_mtime cmd = self._command(tempFilename, text, jumpIndex) - subprocess.run(cmd, shell=platform == 'win32') + subprocess.run(cmd, shell=platform == 'win32', check=True) lastChangeDate = os.stat(tempFilename).st_mtime if lastChangeDate == creationDate: # Nothing changed diff --git a/scripts/shell.py b/scripts/shell.py index 26a582f..f105182 100755 --- a/scripts/shell.py +++ b/scripts/shell.py @@ -52,7 +52,8 @@ import platform import subprocess subprocess.run('title Python {} Shell' - .format(platform.python_version()), shell=True) + .format(platform.python_version()), + shell=True, check=True) del subprocess del platform args = []