[ci-custom] Fix after switch from string to path (#12314)

This commit is contained in:
Clyde Stubbs
2025-12-07 00:49:23 +11:00
committed by GitHub
parent 7eae0a4972
commit 3c7d6b7fc6

View File

@@ -554,10 +554,10 @@ def convert_path_to_relative(abspath, current):
"esphome/components/web_server/__init__.py",
],
)
def lint_relative_py_import(fname, line, col, content):
def lint_relative_py_import(fname: Path, line, col, content):
import_line = content.splitlines()[line]
abspath = import_line[col:].split(" ")[0]
current = fname.removesuffix(".py").replace(os.path.sep, ".")
current = str(fname).removesuffix(".py").replace(os.path.sep, ".")
replacement = convert_path_to_relative(abspath, current)
newline = import_line.replace(abspath, replacement)
return (