mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-09 22:25:00 +00:00
Merge pull request #3869 from titusz/fix/shlex
Fix shlex.quote() use in linter on Windows
This commit is contained in:
commit
cbaaf96324
5 changed files with 24 additions and 8 deletions
|
@ -4,7 +4,7 @@ import subprocess
|
|||
import sys
|
||||
import traceback
|
||||
import warnings
|
||||
import shlex
|
||||
import oslex
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
|
@ -45,7 +45,7 @@ class Linter:
|
|||
return fname
|
||||
|
||||
def run_cmd(self, cmd, rel_fname, code):
|
||||
cmd += " " + shlex.quote(rel_fname)
|
||||
cmd += " " + oslex.quote(rel_fname)
|
||||
|
||||
returncode = 0
|
||||
stdout = ""
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import itertools
|
||||
import os
|
||||
import platform
|
||||
import shlex
|
||||
import oslex
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
@ -384,10 +384,7 @@ def printable_shell_command(cmd_list):
|
|||
Returns:
|
||||
str: Shell-escaped command string.
|
||||
"""
|
||||
if platform.system() == "Windows":
|
||||
return subprocess.list2cmdline(cmd_list)
|
||||
else:
|
||||
return shlex.join(cmd_list)
|
||||
return oslex.join(cmd_list)
|
||||
|
||||
|
||||
def main():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue