Am 15. September 2011 02:38 schrieb Agata Murawska <[email protected]>:
> +class Converter(object):
> +  def Cleanup(self):
> +    """Cleans the temporary directory, if one was created.
> +
> +    """
> +    if self.temp_dir:
> +      shutil.rmtree(self.temp_dir)
> +      self.temp_dir = None
> +    for file_name in self.temp_compress:
> +      utils.RemoveFile(file_name)
> +    self.temp_compress = []

Why aren't you using tempfile.NamedTemporaryFile for temporary storage
space? Your method is anything but safe (think about exceptions being
raised).

Michael

Reply via email to