From 74be4a2abfb0be83bacce04dcc531968dc31c4b9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 1 Oct 2010 18:52:10 +0200 Subject: land: Avoid more uses of chdir(). --- script/land.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'script') diff --git a/script/land.py b/script/land.py index 20ac8260c4..78160af8ba 100755 --- a/script/land.py +++ b/script/land.py @@ -128,11 +128,8 @@ class builder(object): if self.output_mime_type == "text/x-subunit": self.cmd += " | %s --immediate" % (os.path.join(os.path.dirname(__file__), "selftest/format-subunit")) print '%s: [%s] Running %s' % (self.name, self.stage, self.cmd) - cwd = os.getcwd() - os.chdir("%s/%s" % (self.sdir, self.dir)) - self.proc = Popen(self.cmd, shell=True, + self.proc = Popen(self.cmd, shell=True, cwd="%s/%s" % (self.sdir, self.dir), stdout=self.stdout, stderr=self.stderr, stdin=self.stdin) - os.chdir(cwd) self.next += 1 @@ -224,11 +221,8 @@ class buildlist(object): os.unlink(b.stderr_path) def start_tail(self): - cwd = os.getcwd() cmd = "tail -f *.stdout *.stderr" - os.chdir(gitroot) - self.tail_proc = Popen(cmd, shell=True) - os.chdir(cwd) + self.tail_proc = Popen(cmd, shell=True, cwd=gitroot) def cleanup(): -- cgit