summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-03 03:03:12 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-10-03 03:03:12 +0200
commit1b440827a04ad23efb891eff28d90f172723c75d (patch)
treecc6a7c3f01285151bf5dcc01c6fdaa428528e4e3
parent06b16115bee85d7dd12a51c7476b0655068a970c (diff)
downloadgitpython-1b440827a04ad23efb891eff28d90f172723c75d.tar.gz
repo-TC: FIX HOME-expansion check, Appveyor has no HOME var
-rw-r--r--git/test/test_repo.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/git/test/test_repo.py b/git/test/test_repo.py
index ae2bf2f0..7c96cc48 100644
--- a/git/test/test_repo.py
+++ b/git/test/test_repo.py
@@ -486,7 +486,7 @@ class TestRepo(TestBase):
@with_rw_directory
def test_tilde_and_env_vars_in_repo_path(self, rw_dir):
- ph = os.environ['HOME']
+ ph = os.environ.get('HOME')
try:
os.environ['HOME'] = rw_dir
Repo.init(os.path.join('~', 'test.git'), bare=True)
@@ -494,8 +494,9 @@ class TestRepo(TestBase):
os.environ['FOO'] = rw_dir
Repo.init(os.path.join('$FOO', 'test.git'), bare=True)
finally:
- os.environ['HOME'] = ph
- del os.environ['FOO']
+ if ph:
+ os.environ['HOME'] = ph
+ del os.environ['FOO']
# end assure HOME gets reset to what it was
def test_git_cmd(self):