Skip to content

Commit

Permalink
Fixed compability with newer pip versions
Browse files Browse the repository at this point in the history
  • Loading branch information
borisrozumnuk authored and borisrozumnuk committed May 8, 2018
1 parent 60248a0 commit 1f890d4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Copyright (c) 2015, Ayun Park. All rights reserved.
# For licensing, see LICENSE file included in the package.
import sys

import pkgutil
from setuptools import setup
from setuptools.command.install import install

Expand All @@ -13,13 +13,8 @@ class NewInstall(install):

@staticmethod
def check_pymongo():
try:
from pip._internal import get_installed_distributions
except ImportError:
from pip import get_installed_distributions
for package in get_installed_distributions():
if package.project_name == 'pymongo':
return True
if pkgutil.find_loader('pymongo'):
return True
return False

def run(self):
Expand Down

0 comments on commit 1f890d4

Please sign in to comment.