Skip to contentSkip to conversation

bno_plot.py: Use shutil.rmtree() instead of os.system('/bin/rm')

PATCH New Vincent Legoll 1 participant 1 message Mar 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 2/10 bno_plot.py: Use shutil.rmtree() instead of os.system('/bin/rm')

---
 btt/bno_plot.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
btt/bno_plot.py +2 -2
index f05cfdc..36fc524 100644
@@ -40,7 +40,7 @@ To exit the plotter, enter 'quit' or ^D at the 'gnuplot> ' prompt.
 
 from __future__ import absolute_import
 from __future__ import print_function
-import getopt, glob, os, sys, tempfile
+import getopt, glob, os, sys, tempfile, shutil
 
 verbose	= 0
 cmds	= """
@@ -125,4 +125,4 @@ if __name__ = '__main__':
 		sys.exit(1)
 
 	os.waitpid(pid, 0)
-	os.system('/bin/rm -rf ' + tmpdir)
+	shutil.rmtree(tmpdir)
Signature · 1 line
2.20.1