fix: fix some error

This commit is contained in:
2024-06-03 21:17:42 +08:00
parent 4a55822a8f
commit 4f5c67b32e
2 changed files with 18 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
from typing import Tuple
from git import Repo
from git import Repo # type: ignore
import random
from pathlib import Path
@@ -44,7 +44,7 @@ def inject_random_backdoor(
injected_python_files.append(python_file)
injectedNum = len(injected_python_files)
for python_file in injected_python_files:
with open(python_file, "r+",errors="ignore") as f:
with open(python_file, "r+", errors="ignore") as f:
lines = f.readlines()
total_lines = len(lines)
inject_line_number = random.randint(0, total_lines)