mirror of https://github.com/pypa/pip
factor out any()
This commit is contained in:
parent
98358cde0c
commit
493407a758
|
@ -37,6 +37,7 @@ import ConfigParser
|
|||
from distutils.util import strtobool
|
||||
from distutils import sysconfig
|
||||
from pip.log import logger
|
||||
from pip.backwardcompat import any
|
||||
|
||||
class InstallationError(Exception):
|
||||
"""General exception during installation"""
|
||||
|
@ -50,15 +51,6 @@ class DistributionNotFound(InstallationError):
|
|||
class BadCommand(Exception):
|
||||
"""Raised when virtualenv or a command is not found"""
|
||||
|
||||
try:
|
||||
any
|
||||
except NameError:
|
||||
def any(seq):
|
||||
for item in seq:
|
||||
if item:
|
||||
return True
|
||||
return False
|
||||
|
||||
if getattr(sys, 'real_prefix', None):
|
||||
## FIXME: is build/ a good name?
|
||||
build_prefix = os.path.join(sys.prefix, 'build')
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
"""Stuff that isn't in some old versions of Python"""
|
||||
|
||||
__all__ = ['any']
|
||||
|
||||
try:
|
||||
any
|
||||
except NameError:
|
||||
def any(seq):
|
||||
for item in seq:
|
||||
if item:
|
||||
return True
|
||||
return False
|
Loading…
Reference in New Issue