Skip to content

Instantly share code, notes, and snippets.

@tomprince
Created January 28, 2014 00:16
Show Gist options
  • Save tomprince/8660058 to your computer and use it in GitHub Desktop.
Save tomprince/8660058 to your computer and use it in GitHub Desktop.
diff --git a/contrib/build-installer b/contrib/build-installer
index 47f4c6b..8c7b5eb 100755
--- a/contrib/build-installer
+++ b/contrib/build-installer
@@ -40,18 +40,17 @@ tmpdir = None
try:
# Create a temporary working directory
tmpdir = tempfile.mkdtemp()
+ get_pip = os.path.join(tmpdir, "get-pip.py")
# Unpack the zipfile into the temporary directory
- with open(os.path.join(tmpdir, "get-pip.py"), "wb") as fp:
+ with open(get_pip, "wb") as fp:
fp.write(base64.decodestring(ZIPFILE))
# Execute the unpacked zip script using the same interpreter as we're
# currently using.
- p = subprocess.Popen([sys.executable, os.path.join(tmpdir, "get-pip.py")])
- p.wait()
-
- # Exit the script with the exit code that our zip script had
- sys.exit(p.returncode)
+ sys.path.insert(0, get_pip)
+ from bootstrap_pip import bootstrap
+ bootstrap()
finally:
# Clean up our temporary working directory
if tmpdir:
@@ -134,7 +133,7 @@ def main():
z.write(os.path.join(toplevel, filename), filename)
# Give the zip archive a __main__.py that will execute the bootstrap
- z.writestr("__main__.py", BOOTSTRAP_SCRIPT)
+ z.writestr("bootstrap_pip.py", BOOTSTRAP_SCRIPT)
# Get the binary data that compromises our zip file
with open(get_pip, "rb") as fp:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment