Skip to content

Commit

Permalink
don't try to reset $HOME if it wasn't set to begin with
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin J. Mitchell committed Feb 3, 2010
1 parent 254cf9c commit 5e8b9b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion buildbot/test/runs/test_ec2buildslave.py
Expand Up @@ -419,6 +419,8 @@ def testDefaultSeparateFile(self):
if h in os.environ:
home = os.environ[h]
break
else:
home = None

fake_home = os.path.join(os.getcwd(), 'basedir') # see RunMixin.setUp
os.environ['HOME'] = fake_home
Expand All @@ -435,7 +437,10 @@ def testDefaultSeparateFile(self):
# for completeness, we'll show that the connection actually exists.
self.failUnless(isinstance(bot1.conn, Connection))
# clean up.
os.environ['HOME'] = home
if home is None:
del os.environ['HOME']
else:
os.environ['HOME'] = home
self.rmtree(dir)

def testCustomSeparateFile(self):
Expand Down

0 comments on commit 5e8b9b3

Please sign in to comment.