Skip to content

Commit

Permalink
Older GitPython version do not have a close method
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Aug 22, 2018
1 parent 7452715 commit 5a0cda5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/fileserver/test_gitfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,9 @@ def setUpClass(cls):

# 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
Expand All @@ -443,8 +445,6 @@ def tearDownClass(cls):
except OSError as exc:
if exc.errno != errno.EEXIST:
raise
except Exception:
log.exception("Exception encountered durring recursive remove: %s", path)

def setUp(self):
'''
Expand Down

0 comments on commit 5a0cda5

Please sign in to comment.