From b632cd111e8377968ec1cba64dd72054a6650cde Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Tue, 26 Dec 2006 11:54:13 -0800 Subject: [PATCH] [RARSLAVE] Fix directory switching 2 Important bugfix. This resets the directory we are in after running the command given to run_command(). This is the expected behavior, but was overlooked. None of the current code relies on this behavior, but it's good to act as expected, anyway. Signed-off-by: Ira W. Snyder --- rarslave.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rarslave.py b/rarslave.py index 657fa72..5be2b2f 100644 --- a/rarslave.py +++ b/rarslave.py @@ -170,7 +170,9 @@ def run_command (cmd, indir=None): assert os.path.isdir (indir) # MUST be a directory! os.chdir (indir) - return os.system (cmd) + ret = os.system (cmd) + os.chdir (pwd) + return ret def full_abspath (p): return os.path.abspath (os.path.expanduser (p)) -- 2.25.1