b4009530 by 周伟奇

add remove tmp file

1 parent d6a270fd
...@@ -285,10 +285,12 @@ class DocView(GenericView, DocHandler): ...@@ -285,10 +285,12 @@ class DocView(GenericView, DocHandler):
285 try: 285 try:
286 file = fitz.Document(tmp_save_path) 286 file = fitz.Document(tmp_save_path)
287 except Exception as e: 287 except Exception as e:
288 os.remove(tmp_save_path)
288 raise self.invalid_params(msg='invalid params: not a PDF file') 289 raise self.invalid_params(msg='invalid params: not a PDF file')
289 else: 290 else:
290 if not file.isPDF: 291 if not file.isPDF:
291 file.close() 292 file.close()
293 os.remove(tmp_save_path)
292 raise self.invalid_params(msg='invalid params: not a PDF file') 294 raise self.invalid_params(msg='invalid params: not a PDF file')
293 295
294 file.close() 296 file.close()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!