~ubuntu-branches/debian/stretch/protobuf/stretch

« back to all changes in this revision

Viewing changes to python/ez_setup.py

  • Committer: Package Import Robot
  • Author(s): Robert S. Edmonds
  • Date: 2014-09-11 22:50:10 UTC
  • mfrom: (10.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20140911225010-wt4yo9dpc1fzuq5g
Tags: 2.6.0-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
    """
100
100
    was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
101
101
    def do_download():
102
 
        print >>sys.stderr, (
103
 
        "The required version of setuptools (>=%s) is not available, and\n"
104
 
        "can't be installed during Debian package builds.") % version
105
 
        sys.exit(2)
 
102
        egg = download_setuptools(version, download_base, to_dir, download_delay)
 
103
        sys.path.insert(0, egg)
 
104
        import setuptools; setuptools.bootstrap_install_from = egg
106
105
    try:
107
106
        import pkg_resources
108
107
    except ImportError:
109
108
        return do_download()       
110
109
    try:
 
110
        return do_download()
111
111
        pkg_resources.require("setuptools>="+version); return
112
112
    except pkg_resources.VersionConflict, e:
113
113
        if was_imported: