diff --git a/hgext/git/index.py b/hgext/git/index.py --- a/hgext/git/index.py +++ b/hgext/git/index.py @@ -4,8 +4,6 @@ import os import sqlite3 -import pygit2 - from mercurial.i18n import _ from mercurial import ( @@ -15,6 +13,13 @@ pycompat, ) +# This looks goofy, but it appeases test-check-imports which has funny +# ideas about where this import belongs. +try: + import pygit2 +except ImportError: + raise + from . import gitutil