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