mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
some fixes discovered with pyflakes
This commit is contained in:
parent
9e203e0637
commit
f8fac58d73
@ -4,15 +4,14 @@
|
|||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import optparse
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from gunicorn import __version__
|
|
||||||
from gunicorn import util
|
from gunicorn import util
|
||||||
from gunicorn.arbiter import Arbiter
|
from gunicorn.arbiter import Arbiter
|
||||||
from gunicorn.config import Config
|
from gunicorn.config import Config
|
||||||
from gunicorn.debug import spew
|
from gunicorn import debug
|
||||||
|
|
||||||
class Application(object):
|
class Application(object):
|
||||||
"""\
|
"""\
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import sys
|
|||||||
from django.core.handlers.wsgi import WSGIHandler
|
from django.core.handlers.wsgi import WSGIHandler
|
||||||
from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException
|
from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException
|
||||||
|
|
||||||
from gunicorn import util
|
|
||||||
from gunicorn.config import Config
|
from gunicorn.config import Config
|
||||||
from gunicorn.app.base import Application
|
from gunicorn.app.base import Application
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
import copy
|
|
||||||
import errno
|
import errno
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@ -17,7 +16,6 @@ import traceback
|
|||||||
|
|
||||||
from gunicorn.pidfile import Pidfile
|
from gunicorn.pidfile import Pidfile
|
||||||
from gunicorn.sock import create_socket
|
from gunicorn.sock import create_socket
|
||||||
from gunicorn.workers.sync import SyncWorker
|
|
||||||
from gunicorn import util
|
from gunicorn import util
|
||||||
|
|
||||||
class Arbiter(object):
|
class Arbiter(object):
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import inspect
|
|||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
import pwd
|
import pwd
|
||||||
import sys
|
|
||||||
import textwrap
|
import textwrap
|
||||||
import types
|
import types
|
||||||
|
|
||||||
@ -90,7 +89,7 @@ class Config(object):
|
|||||||
group = self.settings['group'].get()
|
group = self.settings['group'].get()
|
||||||
if not group:
|
if not group:
|
||||||
return os.getegid()
|
return os.getegid()
|
||||||
elif group.isdigit() or isinstance(user, int):
|
elif group.isdigit() or isinstance(group, int):
|
||||||
return int(group)
|
return int(group)
|
||||||
else:
|
else:
|
||||||
return grp.getgrnam(group).gr_gid
|
return grp.getgrnam(group).gr_gid
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
from optparse import make_option
|
from optparse import make_option
|
||||||
import sys
|
import sys
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
import django
|
import django
|
||||||
@ -13,7 +12,6 @@ from django.core.management.base import BaseCommand, CommandError
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import translation
|
from django.utils import translation
|
||||||
|
|
||||||
from gunicorn.config import Config
|
|
||||||
from gunicorn.app.djangoapp import DjangoApplicationCommand
|
from gunicorn.app.djangoapp import DjangoApplicationCommand
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
|||||||
@ -226,7 +226,7 @@ def daemonize():
|
|||||||
else:
|
else:
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
maxfd = util.get_maxfd()
|
maxfd = get_maxfd()
|
||||||
|
|
||||||
# Iterate through and close all file descriptors.
|
# Iterate through and close all file descriptors.
|
||||||
for fd in range(0, maxfd):
|
for fd in range(0, maxfd):
|
||||||
@ -235,6 +235,6 @@ def daemonize():
|
|||||||
except OSError: # ERROR, fd wasn't open to begin with (ignored)
|
except OSError: # ERROR, fd wasn't open to begin with (ignored)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
os.open(util.REDIRECT_TO, os.O_RDWR)
|
os.open(REDIRECT_TO, os.O_RDWR)
|
||||||
os.dup2(0, 1)
|
os.dup2(0, 1)
|
||||||
os.dup2(0, 2)
|
os.dup2(0, 2)
|
||||||
Loading…
x
Reference in New Issue
Block a user