Skip to content

Commit b169643

Browse files
fix: handle PosixPath in file path checks
Co-Authored-By: [email protected] <[email protected]>
1 parent eea30a9 commit b169643

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.codegen/codemods/dict_to_schema/dict_to_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def run(codebase: Codebase):
3939
models_created = 0
4040

4141
# Process all Python files in the codebase
42-
total_files = len([f for f in codebase.files if f.path.endswith('.py')])
42+
total_files = len([f for f in codebase.files if str(f.path).endswith('.py')])
4343
print("\n\033[1;36m📁 Scanning files for dictionary literals...\033[0m")
4444
print(f"Found {total_files} Python files to process")
4545

@@ -66,7 +66,7 @@ def process_dict_assignment(source: str, name: str) -> tuple[str, str]:
6666
init_code = f"{name} = {class_name}(**{dict_str})"
6767
return model_def, init_code
6868

69-
for i, file in enumerate([f for f in codebase.files if f.path.endswith('.py')], 1):
69+
for i, file in enumerate([f for f in codebase.files if str(f.path).endswith('.py')], 1):
7070
needs_imports = False
7171
file_modified = False
7272

0 commit comments

Comments
 (0)