Older GitPython version do not have a close method

This commit is contained in:
Daniel A. Wozniak 2018-08-22 00:16:01 -07:00 committed by rallytime
parent d5fecba716
commit 4723c69092
No known key found for this signature in database
GPG Key ID: E8F1A4B90D0DEA19

View File

@ -424,7 +424,9 @@ class GitFSTestBase(object):
# Add a tag
repo.create_tag(TAG_NAME, 'HEAD')
repo.close()
# Older GitPython versions do not have a close method.
if hasattr(repo, 'close'):
repo.close()
finally:
if orig_username is not None:
os.environ[username_key] = orig_username
@ -443,8 +445,6 @@ class GitFSTestBase(object):
except OSError as exc:
if exc.errno != errno.EEXIST:
raise
except Exception:
log.exception("Exception encountered durring recursive remove: %s", path)
def setUp(self):
'''