From 8c24523d9aea8052ea10fbfa3f813000788e53fb 2012-09-12 17:29:45 From: Fernando Perez Date: 2012-09-12 17:29:45 Subject: [PATCH] Remove _files directory at the end if empty. --- diff --git a/nbconvert.py b/nbconvert.py index 45f37f2..02d2218 100755 --- a/nbconvert.py +++ b/nbconvert.py @@ -255,6 +255,10 @@ class Converter(object): self.files_dir = files_dir self.outbase = os.path.join(self.infile_dir, infile_root) + def __del__(self): + if not os.listdir(self.files_dir): + os.rmdir(self.files_dir) + def dispatch(self, cell_type): """return cell_type dependent render method, for example render_code """