Commit b1e7b3a8 by Pierre Le Marre

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
parent fa21ba52
from __future__ import unicode_literals from __future__ import unicode_literals
import os import os
import shutil
import subprocess import subprocess
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
...@@ -146,6 +147,6 @@ class SubProcessCompiler(CompilerBase): ...@@ -146,6 +147,6 @@ class SubProcessCompiler(CompilerBase):
# Decide what to do with captured stdout. # Decide what to do with captured stdout.
if stdout: if stdout:
if stdout_captured: if stdout_captured:
os.rename(stdout.name, os.path.join(cwd or os.curdir, stdout_captured)) shutil.move(stdout.name, os.path.join(cwd or os.curdir, stdout_captured))
else: else:
os.remove(stdout.name) os.remove(stdout.name)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment