style: Fix import order and formatting in editblock_coder.py

This commit is contained in:
Paul Gauthier (aider) 2024-08-20 19:25:13 -07:00
parent 4917054518
commit 0006d70a7c

View file

@ -1,5 +1,6 @@
import difflib
import math
import os
import re
import subprocess
import sys
@ -13,8 +14,6 @@ from .base_coder import Coder
from .editblock_prompts import EditBlockPrompts
import os
class EditBlockCoder(Coder):
"""A coder that uses search/replace blocks for code modifications."""
@ -30,10 +29,11 @@ class EditBlockCoder(Coder):
return edits
def run_interactive_subprocess(self, command):
if os.name == 'posix': # Unix-like systems (Linux, macOS)
if os.name == "posix": # Unix-like systems (Linux, macOS)
import pty
return pty.spawn(command)
elif os.name == 'nt': # Windows
elif os.name == "nt": # Windows
return subprocess.run(command, shell=True)
else:
raise OSError("Unsupported operating system")