mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
don't remove the file under cygwin.
Thanks to @pombredanne for the report. fix #407
This commit is contained in:
parent
84d9f4c604
commit
8ab090aafb
@ -4,10 +4,16 @@
|
|||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from gunicorn import util
|
from gunicorn import util
|
||||||
|
|
||||||
|
PLATFORM = platform.system()
|
||||||
|
if PLATFORM.startswith('CYGWIN'):
|
||||||
|
IS_CYGWIN = True
|
||||||
|
else:
|
||||||
|
IS_CYGWIN = False
|
||||||
|
|
||||||
class WorkerTmp(object):
|
class WorkerTmp(object):
|
||||||
|
|
||||||
@ -21,7 +27,8 @@ class WorkerTmp(object):
|
|||||||
|
|
||||||
# unlink the file so we don't leak tempory files
|
# unlink the file so we don't leak tempory files
|
||||||
try:
|
try:
|
||||||
util.unlink(name)
|
if not IS_CYGWIN:
|
||||||
|
util.unlink(name)
|
||||||
self._tmp = os.fdopen(fd, 'w+b', 1)
|
self._tmp = os.fdopen(fd, 'w+b', 1)
|
||||||
except:
|
except:
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user