Commit 3cca9c10 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

bugfix: the file may not exist

parent 81bcdeea
......@@ -17,7 +17,9 @@
#
import errno
import json
import os
import os.path
import subprocess
import sys
......@@ -101,7 +103,12 @@ class ScriptDocumentation(IncludeCommand):
def cleanup_pod2html_tmp(app, exception):
os.remove("pod2htmd.tmp")
# Stolen from https://stackoverflow.com/questions/10840533/most-pythonic-way-to-delete-a-file-which-may-not-exist
try:
os.remove("pod2htmd.tmp")
except OSError as e: # this would be "except OSError, e:" before Python 2.6
if e.errno != errno.ENOENT: # errno.ENOENT = no such file or directory
raise # re-raise exception if a different error occurred
def setup(app):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment