streamball.ZipBall tweaks

This commit is contained in:
Dannon Baker
2020-08-05 18:36:02 -04:00
parent 867ce47e98
commit 1914001c75
+4 -3
View File
@@ -48,12 +48,13 @@ class ZipBall(object):
def __init__(self, tmpf, tmpd):
self._tmpf = tmpf
self._tmpd = tmpd
self.wsgi_status = None
self.wsgi_headeritems = None
def stream(self, environ, start_response):
response_write = start_response(self.wsgi_status, self.wsgi_headeritems)
tmpfh = open(self._tmpf)
response_write(tmpfh.read())
tmpfh.close()
with open(self._tmpf, 'rb') as tmpfh:
response_write(tmpfh.read())
try:
os.unlink(self._tmpf)
os.rmdir(self._tmpd)