Skip to content

Commit bd4649c

Browse files
authored
Merge pull request #11634 from WeatherGod/backport_11624
Backport #11624
2 parents 05c9a12 + 08e6c6c commit bd4649c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ def report_memory(i=0): # argument may go away
13001300
pid = os.getpid()
13011301
if sys.platform == 'sunos5':
13021302
try:
1303-
a2 = Popen(str('ps -p %d -o osz') % pid, shell=True,
1303+
a2 = Popen(['ps', '-p', '%d' % pid, '-o', 'osz'],
13041304
stdout=PIPE).stdout.readlines()
13051305
except OSError:
13061306
raise NotImplementedError(
@@ -1309,7 +1309,7 @@ def report_memory(i=0): # argument may go away
13091309
mem = int(a2[-1].strip())
13101310
elif sys.platform.startswith('linux'):
13111311
try:
1312-
a2 = Popen(str('ps -p %d -o rss,sz') % pid, shell=True,
1312+
a2 = Popen(['ps', '-p', '%d' % pid, '-o', 'rss,sz'],
13131313
stdout=PIPE).stdout.readlines()
13141314
except OSError:
13151315
raise NotImplementedError(
@@ -1318,7 +1318,7 @@ def report_memory(i=0): # argument may go away
13181318
mem = int(a2[1].split()[1])
13191319
elif sys.platform.startswith('darwin'):
13201320
try:
1321-
a2 = Popen(str('ps -p %d -o rss,vsz') % pid, shell=True,
1321+
a2 = Popen(['ps', '-p', '%d' % pid, '-o', 'rss,vsz'],
13221322
stdout=PIPE).stdout.readlines()
13231323
except OSError:
13241324
raise NotImplementedError(

0 commit comments

Comments
 (0)