Ubuntu Pastebin

Paste from smoser at Thu, 3 Nov 2016 20:12:51 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
diff --git a/usd/GitRepository.py b/usd/GitRepository.py
index 391fccd..861bc59 100644
--- a/usd/GitRepository.py
+++ b/usd/GitRepository.py
@@ -448,9 +448,10 @@ class USDGitRepository:
             commit_tree += ['-p', upload_parent_commit]
         commit_env = copy.copy(self._env)
         commit_env.update(self.get_commit_environment(tree_hash, spi, patch_overrides))
+        commit_msg_file = None
         try:
-            _, commit_msg_file = tempfile.mkstemp()
-            with open(commit_msg_file, "wb") as fp:
+            with tempfile.NamedTemporaryFile(delete=False) as fp:
+                commit_msg_file = fp.name
                 fp.write(msg)
             commit_tree += ['-F', commit_msg_file]
             cp = run(commit_tree, env=commit_env)
Download as text