1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-21 20:38:54 +00:00

Avoid importing pip

pip doesn't have a stable Python API and shouldn't be `import`ed. `pkg_resources` is provided by setuptools.
This commit is contained in:
Tim D. Smith 2016-06-28 21:48:06 -07:00 committed by GitHub
parent ae2b767a4d
commit 99e828d15d

View File

@ -1,10 +1,10 @@
#!/usr/bin/env python #!/usr/bin/env python
from setuptools import setup, find_packages from setuptools import setup, find_packages
import pip import pkg_resources
import sys import sys
import os import os
if int(pip.__version__.split('.')[0]) < 6: if int(pkg_resources.get_distribution("pip").version.split('.')[0]) < 6:
print('pip older than 6.0 not supported, please upgrade pip with:\n\n' print('pip older than 6.0 not supported, please upgrade pip with:\n\n'
' pip install -U pip') ' pip install -U pip')
sys.exit(-1) sys.exit(-1)