Fixed unclosed file handles
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7a9d098107
commit
bafd6be131
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user