Skip to content

Commit

Permalink
Fix for Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-zeller committed Feb 9, 2025
1 parent 1a23703 commit d115d2f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/fandango/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,12 @@ def fuzz_command(args):

# Ensure that every generated file can be parsed
# and returns the same string as the original
temp_dir = tempfile.TemporaryDirectory(delete=False)
try:
temp_dir = tempfile.TemporaryDirectory(delete=False)
except TypeError:
# Python 3.11 does not know the `delete` argument
temp_dir = tempfile.TemporaryDirectory()

args.directory = temp_dir.name
args.format = "string"
output_population(population, args, file_mode=file_mode, output_on_stdout=False)
Expand Down

0 comments on commit d115d2f

Please sign in to comment.