INNER CODE UNIT · Python
open
terraform-aws-modules/terraform-aws-lambda · package.py:331
def open(self):
if self._tmp_filename:
raise zipfile.BadZipFile("ZipStream object can't be reused")
self._ensure_base_path(self.filename)
self._tmp_filename = "{}.tmp".format(self.filename)
if not self.quiet:
self._log.info("creating '%s' archive", self.filename)
self._zip = zipfile.ZipFile(self._tmp_filename, "w", self._compress_type)
return self
def close(self, failed=False):
self._zip.close()
self._zip = None
if not os.path.exists(self._tmp_filename):
return
if failed:
os.unlink(self._tmp_filename)
else: