Skip to content

Commit

Permalink
Fix compatibility with pygit2 < 1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
mgorny committed Nov 11, 2024
1 parent 6b820d7 commit 3aa51f9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions conda_smithy/feedstock_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ def get_repo(path, search_parent_directories=True):
if search_parent_directories:
path = pygit2.discover_repository(path)
if path is not None:
repo = pygit2.Repository(
path, pygit2.enums.RepositoryOpenFlag.NO_SEARCH
)
try:
NO_SEARCH = pygit2.enums.RepositoryOpenFlag.NO_SEARCH
except AttributeError: # pygit2 < 1.14
NO_SEARCH = pygit2.GIT_REPOSITORY_OPEN_NO_SEARCH

repo = pygit2.Repository(path, NO_SEARCH)
except ImportError:
pass
except pygit2.GitError:
Expand Down

0 comments on commit 3aa51f9

Please sign in to comment.