Skip empty files in get repo file dependencies (#254)

Co-authored-by: Rita Aleksziev <alekszievr@gmail..com>
This commit is contained in:
alekszievr 2024-12-04 17:29:07 +01:00 committed by GitHub
parent df8fc829f9
commit ac62e9809a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,6 +34,10 @@ async def get_py_files_dict(repo_path):
py_files_dict = {}
for file_path in py_files_paths:
absolute_path = os.path.abspath(file_path)
if os.path.getsize(absolute_path) == 0:
continue
relative_path, source_code = await get_py_path_and_source(absolute_path)
py_files_dict[relative_path] = {"source_code": source_code}