From: Ira W. Snyder Date: Tue, 26 Dec 2006 19:54:13 +0000 (-0800) Subject: [RARSLAVE] Fix directory switching 2 X-Git-Tag: v2.0.0~39 X-Git-Url: https://www.irasnyder.com/gitweb/?a=commitdiff_plain;h=b632cd111e8377968ec1cba64dd72054a6650cde;p=rarslave2.git [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 --- 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))