jenkins-bot submitted this change.

View Change

Approvals: Zhuyifei1999: Looks good to me, approved jenkins-bot: Verified
[4.0] replace os.system call by subprocess.run as suggested

https://docs.python.org/3.5/library/subprocess.html#replacing-os-system

Change-Id: I7448cecc3df54f2056251f82c4a48cf667d834a8
---
M scripts/shell.py
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/scripts/shell.py b/scripts/shell.py
index 3223520..2857154 100755
--- a/scripts/shell.py
+++ b/scripts/shell.py
@@ -14,13 +14,10 @@

If no arguments are given, the pywikibot library will not be loaded.
"""
-# (C) Pywikibot team, 2014-2018
+# (C) Pywikibot team, 2014-2020
#
# Distributed under the terms of the MIT license.
#
-from __future__ import (absolute_import, division,
- print_function, unicode_literals)
-
import code
import sys

@@ -53,9 +50,10 @@

if __name__ == '__main__':
if sys.platform == 'win32':
- import os
- os.system('title Python {} Shell'.format(*sys.version.split(' ', 1)))
- del os
+ import subprocess
+ subprocess.run('title Python {} Shell'
+ .format(*sys.version.split(' ', 1)), shell=True)
+ del subprocess
args = []
if sys.argv and sys.argv[0].endswith(('shell', 'shell.py')):
args = sys.argv[1:]

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7448cecc3df54f2056251f82c4a48cf667d834a8
Gerrit-Change-Number: 609579
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged