jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[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(-)

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 = []

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3ae37085244cb0131b2b23348f227b513baa4
Gerrit-Change-Number: 743360
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged