Skip to content

Commit b1e7b3a

Browse files
author
Pierre Le Marre
committed
Replace os.rename with shutil.move, as it raises a FileExistsError on Windows.
See: - http://stackoverflow.com/a/8107391 - https://docs.python.org/2/library/os.html?highlight=os.rename#os.rename
1 parent fa21ba5 commit b1e7b3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pipeline/compilers/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import unicode_literals
22

33
import os
4+
import shutil
45
import subprocess
56
from tempfile import NamedTemporaryFile
67

@@ -146,6 +147,6 @@ def execute_command(self, command, cwd=None, stdout_captured=None):
146147
# Decide what to do with captured stdout.
147148
if stdout:
148149
if stdout_captured:
149-
os.rename(stdout.name, os.path.join(cwd or os.curdir, stdout_captured))
150+
shutil.move(stdout.name, os.path.join(cwd or os.curdir, stdout_captured))
150151
else:
151152
os.remove(stdout.name)

0 commit comments

Comments
 (0)