mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Use more Pythonic style in gunicorn/.
This commit is contained in:
parent
783984cabd
commit
56e7d15fb8
@ -314,7 +314,7 @@ class Logger(object):
|
||||
|
||||
def _get_gunicorn_handler(self, log):
|
||||
for h in log.handlers:
|
||||
if getattr(h, "_gunicorn", False) == True:
|
||||
if getattr(h, "_gunicorn", False):
|
||||
return h
|
||||
|
||||
def _set_handler(self, log, output, fmt):
|
||||
|
||||
@ -406,7 +406,7 @@ def daemonize(enable_stdio_inheritance=False):
|
||||
Standard daemonization of a process.
|
||||
http://www.svbug.com/documentation/comp.unix.programmer-FAQ/faq_2.html#SEC16
|
||||
"""
|
||||
if not 'GUNICORN_FD' in os.environ:
|
||||
if 'GUNICORN_FD' not in os.environ:
|
||||
if os.fork():
|
||||
os._exit(0)
|
||||
os.setsid()
|
||||
|
||||
@ -7,7 +7,7 @@ import sys
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
try:
|
||||
import aiohttp
|
||||
import aiohttp # NOQA
|
||||
except ImportError:
|
||||
raise RuntimeError("You need aiohttp installed to use this worker.")
|
||||
else:
|
||||
|
||||
@ -15,7 +15,6 @@ from datetime import datetime
|
||||
import errno
|
||||
from functools import partial
|
||||
import os
|
||||
import operator
|
||||
import socket
|
||||
import ssl
|
||||
import sys
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user