mirror of
https://github.com/esphome/esphome.git
synced 2026-01-09 19:50:49 -07:00
[ci-custom] Fix after switch from string to path (#12314)
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user