From 1d1c9e256135802cb19202ff85574b94050d0c59 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Apr 18 2020 14:10:56 +0000 Subject: support pygit2 >= 1.1.0 the method for importing _pygit2 has changed. this patch attempts both the new and old methods. --- diff --git a/pagure/perfrepo.py b/pagure/perfrepo.py index e351312..39f1204 100644 --- a/pagure/perfrepo.py +++ b/pagure/perfrepo.py @@ -19,7 +19,11 @@ import types import six import pygit2 -import _pygit2 + +try: + import _pygit2 +except ImportError: + from pygit2 import _pygit2 real_pygit2_repository = pygit2.Repository