From 681c7d43413d2b25db1fd0ecf7614fa2e10f47a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Sun, 27 Sep 2015 14:03:32 +0200 Subject: [PATCH] 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. --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8b37b0f..15dc51e 100644 --- a/setup.py +++ b/setup.py @@ -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')