From d0ec1f7db370a4e65b3c425c15bcd4b35e9127a6 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 09 2017 10:47:09 +0000 Subject: Ignore case when checking the GitError raised It looks like a future version of libgit2 is going to change the case of its error message: https://github.com/libgit2/libgit2/commit/909d5494368a00809bc42f4780e86f4dd66e4422 So in order to be forward compatible, let's just ignore the case when we perform our check. --- diff --git a/pagure/__init__.py b/pagure/__init__.py index 000048b..8cfce94 100644 --- a/pagure/__init__.py +++ b/pagure/__init__.py @@ -615,7 +615,7 @@ def get_remote_repo_path(remote_git, branch_from, loop=False): repo.pull(branch=branch_from, force=True) except pygit2.GitError as err: LOG.debug('Error pull the repo: %s -- error: %s' % (repopath, err)) - if str(err) != 'No Content-Type header in response': + if str(err).lower() != 'no content-type header in response': LOG.exception(err) flask.abort( 500,