[vlc-commits] Upgrade distribute_setup file to work with newer python
Odin Hørthe Omdal
git at videolan.org
Sat Sep 5 23:09:58 CEST 2015
vlc/python | branch: master | Odin Hørthe Omdal <odin.omdal at gmail.com> | Sat Sep 5 19:49:42 2015 +0200| [0162f06fcb9289c4bc49c28300470357efc2423e] | committer: Olivier Aubert
Upgrade distribute_setup file to work with newer python
Setuptools 0.7b and later is preferable to distribute.
Signed-off-by: Olivier Aubert <contact at olivieraubert.net>
> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=0162f06fcb9289c4bc49c28300470357efc2423e
---
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()
More information about the vlc-commits
mailing list