[vlc-devel] [PATCH 1/2] Upgrade distribute_setup file to work with newer python
Odin Hørthe Omdal
odin.omdal at gmail.com
Sat Sep 5 19:49:42 CEST 2015
Setuptools 0.7b and later is preferable to distribute.
---
distribute_setup.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/distribute_setup.py b/distribute_setup.py
index f9dc2d7..3553b21 100644
--- a/distribute_setup.py
+++ b/distribute_setup.py
@@ -49,7 +49,7 @@ except ImportError:
args = [quote(arg) for arg in args]
return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
-DEFAULT_VERSION = "0.6.39"
+DEFAULT_VERSION = "0.6.49"
DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
SETUPTOOLS_FAKED_VERSION = "0.6c11"
@@ -144,6 +144,16 @@ def use_setuptools(version=DEFAULT_VERSION,
download_base=DEFAULT_URL,
try:
try:
import pkg_resources
+
+ # Setuptools 0.7b and later is a suitable (and preferable)
+ # substitute for any Distribute version.
+ try:
+ pkg_resources.require("setuptools>=0.7b")
+ return
+ except (pkg_resources.DistributionNotFound,
+ pkg_resources.VersionConflict):
+ pass
+
if not hasattr(pkg_resources, '_distribute'):
if not no_fake:
_fake_setuptools()
--
2.5.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150905/ee273d7c/attachment.html>
More information about the vlc-devel
mailing list