diff --git a/git/repo/fun.py b/git/repo/fun.py index e3a7bc57a..9d9f84545 100644 --- a/git/repo/fun.py +++ b/git/repo/fun.py @@ -35,7 +35,7 @@ def is_git_dir(d): There is the unlikely danger to throw if we see directories which just look like a worktree dir, but are none.""" if osp.isdir(d): - if (osp.isdir(osp.join(d, 'objects')) or os.environ.has_key('GIT_OBJECT_DIRECTORY')) \ + if (osp.isdir(osp.join(d, 'objects')) or 'GIT_OBJECT_DIRECTORY' in os.environ) \ and osp.isdir(osp.join(d, 'refs')): headref = osp.join(d, 'HEAD') return osp.isfile(headref) or \