From 6f685e45dccb81d0424bc94ed6065cf632cfc49a Mon Sep 17 00:00:00 2001 From: Michael Porter Date: Thu, 30 Jan 2014 19:39:39 -0500 Subject: [PATCH] (#5822) Use `mkstemp` to open a temporary file (as NamedTemporaryFile doesn't take a `delete` argument in Python < 2.6) --- source_control/git | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source_control/git b/source_control/git index 768e315788a..2eb2add1857 100644 --- a/source_control/git +++ b/source_control/git @@ -142,8 +142,8 @@ import re import tempfile def write_ssh_wrapper(): - fh = tempfile.NamedTemporaryFile(delete=False) - wrapper_path = fh.name + fd, wrapper_path = tempfile.mkstemp() + fh = os.fdopen(fd, 'w+b') template = """#!/bin/sh if [ -z "$GIT_SSH_OPTS" ]; then BASEOPTS=""