mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-22 12:58:33 +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:
parent
ae2b767a4d
commit
99e828d15d
4
setup.py
4
setup.py
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user