diff --git a/demo_code.py b/demo_code.py index 9fde50644..3409b90b3 100644 --- a/demo_code.py +++ b/demo_code.py @@ -80,9 +80,9 @@ def get_users(): def tar_something(): - os.tempnam("dir1") - subprocess.Popen("/bin/chown *", shell=True) - o.system("/bin/tar xvzf *") + with os.tmpfile() as tmp_file: + subprocess.Popen("/bin/chown *", shell=True) + o.system("/bin/tar xvzf *") def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): diff --git a/hello.py b/hello.py index dc8227b07..63223d4e1 100644 --- a/hello.py +++ b/hello.py @@ -74,9 +74,9 @@ def get_users(): def tar_something(): - os.tempnam("dir1") - subprocess.Popen("/bin/chown *", shell=True) - o.system("/bin/tar xvzf *") + with os.tmpfile() as tmpf: + subprocess.Popen("/bin/chown *", shell=True) + o.system("/bin/tar xvzf *") def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz):