style(filesystem): move difflib import to top level
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
"""File system tools: read, write, edit."""
|
"""File system tools: read, write, edit."""
|
||||||
|
|
||||||
|
import difflib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
@@ -169,8 +170,6 @@ class EditFileTool(Tool):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _not_found_message(old_text: str, content: str, path: str) -> str:
|
def _not_found_message(old_text: str, content: str, path: str) -> str:
|
||||||
"""Build a helpful error when old_text is not found."""
|
"""Build a helpful error when old_text is not found."""
|
||||||
import difflib
|
|
||||||
|
|
||||||
lines = content.splitlines(keepends=True)
|
lines = content.splitlines(keepends=True)
|
||||||
old_lines = old_text.splitlines(keepends=True)
|
old_lines = old_text.splitlines(keepends=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user