Fixing pip install pygit2

Regression in the latest release, "pip install pygit2" fails if cffi is
not already installed. Should be fixed with this change, not tested.
This commit is contained in:
J. David Ibáñez
2015-09-27 14:03:32 +02:00
parent 8a66da1278
commit 681c7d4341

View File

@@ -46,8 +46,12 @@ import sys
import unittest
# Get cffi major version
import cffi
cffi_major_version = cffi.__version_info__[0]
try:
import cffi
except ImportError:
cffi_major_version = None
else:
cffi_major_version = cffi.__version_info__[0]
# Import stuff from pygit2/_utils.py without loading the whole pygit2 package
sys.path.insert(0, 'pygit2')