Stop using shlex.split for the command and open a shell instead.

This commit is contained in:
Jannis Leidel
2011-05-26 15:20:52 +02:00
parent d0411eba02
commit 0544955a30
2 changed files with 2 additions and 4 deletions

View File

@@ -6,7 +6,6 @@ from django.utils.datastructures import SortedDict
from compressor.conf import settings from compressor.conf import settings
from compressor.exceptions import FilterError from compressor.exceptions import FilterError
from compressor.utils import cmd_split
from compressor.utils.stringformat import FormattableString as fstr from compressor.utils.stringformat import FormattableString as fstr
logger = logging.getLogger("compressor.filters") logger = logging.getLogger("compressor.filters")
@@ -75,8 +74,8 @@ class CompilerFilter(FilterBase):
options["outfile"] = self.outfile.name options["outfile"] = self.outfile.name
try: try:
command = fstr(self.command).format(**options) command = fstr(self.command).format(**options)
proc = subprocess.Popen(cmd_split(command), shell=os.name=='nt', proc = subprocess.Popen(command, shell=True, cwd=self.cwd,
stdout=self.stdout, stdin=self.stdin, stderr=self.stderr, cwd=self.cwd) stdout=self.stdout, stdin=self.stdin, stderr=self.stderr)
if self.infile is None: if self.infile is None:
filtered, err = proc.communicate(self.content) filtered, err = proc.communicate(self.content)
else: else:

View File

@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import sys import sys
from shlex import split as cmd_split
from compressor.exceptions import FilterError from compressor.exceptions import FilterError