Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
nicovank committed May 22, 2024
1 parent 2dc1068 commit d31232f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/anonymizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import argparse
import tempfile
from typing import Tuple
from typing import Optional, Tuple


def anonymize(path: str) -> Tuple[str, str]:
with open(path) as file:
content = file.read()
def anonymize(path: str) -> Tuple[str, Optional[str]]:
with open(path) as original_file:
content = original_file.read()

code = content
answer = None
Expand All @@ -21,11 +21,11 @@ def anonymize(path: str) -> Tuple[str, str]:
except ValueError:
pass

file = tempfile.NamedTemporaryFile(delete=False)
file.write(code.encode("utf-8"))
file.close()
temporary_file = tempfile.NamedTemporaryFile(delete=False)
temporary_file.write(code.encode("utf-8"))
temporary_file.close()

return file.name, answer
return temporary_file.name, answer


if __name__ == "__main__":
Expand Down

0 comments on commit d31232f

Please sign in to comment.