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

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743360
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: Ia6c3ae37085244cb0131b2b23348f227b513baa4
Gerrit-Change-Number: 743360
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[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