Fixed unclosed file handles
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-10-01 19:20:06 +02:00
parent 7a9d098107
commit bafd6be131

View File

@ -51,9 +51,11 @@ class SVMView(FlaskView):
ensure_buckets() ensure_buckets()
# Temporarily save the file, because pyAudioAnalysis can only read files # Temporarily save the file, because pyAudioAnalysis can only read files
_, temp_model_filename = tempfile.mkstemp() temp_model_handle, temp_model_filename = tempfile.mkstemp()
temp_means_filename = temp_model_filename + "MEANS" temp_means_filename = temp_model_filename + "MEANS"
os.close(temp_model_handle) # BRUUUUH
model_file.save(temp_model_filename) model_file.save(temp_model_filename)
means_file.save(temp_means_filename) means_file.save(temp_means_filename)