Skip to content

Commit 32e7ae2

Browse files
authored
Handle None input in sanitize function
1 parent 09dd993 commit 32e7ae2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bigcodebench/sanitize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ def extract_target_code_or_empty(code: str, entrypoint: Optional[str] = None) ->
180180

181181

182182
def sanitize(code: str, entrypoint: Optional[str] = None) -> str:
183+
if code is None:
184+
return ""
183185
sanitized_code = extract_target_code_or_empty(code, entrypoint).strip()
184186
if not sanitized_code:
185187
return code_extract(code)

0 commit comments

Comments
 (0)