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.
|
||||
|
||||
import logging
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from gunicorn import __version__
|
||||
from gunicorn import util
|
||||
from gunicorn.arbiter import Arbiter
|
||||
from gunicorn.config import Config
|
||||
from gunicorn.debug import spew
|
||||
from gunicorn import debug
|
||||
|
||||
class Application(object):
|
||||
"""\
|
||||
|
||||
@ -9,7 +9,6 @@ import sys
|
||||
from django.core.handlers.wsgi import WSGIHandler
|
||||
from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException
|
||||
|
||||
from gunicorn import util
|
||||
from gunicorn.config import Config
|
||||
from gunicorn.app.base import Application
|
||||
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
import copy
|
||||
import errno
|
||||
import logging
|
||||
import os
|
||||
@ -17,7 +16,6 @@ import traceback
|
||||
|
||||
from gunicorn.pidfile import Pidfile
|
||||
from gunicorn.sock import create_socket
|
||||
from gunicorn.workers.sync import SyncWorker
|
||||
from gunicorn import util
|
||||
|
||||
class Arbiter(object):
|
||||
|
||||
@ -11,7 +11,6 @@ import inspect
|
||||
import optparse
|
||||
import os
|
||||
import pwd
|
||||
import sys
|
||||
import textwrap
|
||||
import types
|
||||
|
||||
@ -90,7 +89,7 @@ class Config(object):
|
||||
group = self.settings['group'].get()
|
||||
if not group:
|
||||
return os.getegid()
|
||||
elif group.isdigit() or isinstance(user, int):
|
||||
elif group.isdigit() or isinstance(group, int):
|
||||
return int(group)
|
||||
else:
|
||||
return grp.getgrnam(group).gr_gid
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
from optparse import make_option
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
import django
|
||||
@ -13,7 +12,6 @@ from django.core.management.base import BaseCommand, CommandError
|
||||
from django.conf import settings
|
||||
from django.utils import translation
|
||||
|
||||
from gunicorn.config import Config
|
||||
from gunicorn.app.djangoapp import DjangoApplicationCommand
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
||||
@ -226,7 +226,7 @@ def daemonize():
|
||||
else:
|
||||
os._exit(0)
|
||||
|
||||
maxfd = util.get_maxfd()
|
||||
maxfd = get_maxfd()
|
||||
|
||||
# Iterate through and close all file descriptors.
|
||||
for fd in range(0, maxfd):
|
||||
@ -235,6 +235,6 @@ def daemonize():
|
||||
except OSError: # ERROR, fd wasn't open to begin with (ignored)
|
||||
pass
|
||||
|
||||
os.open(util.REDIRECT_TO, os.O_RDWR)
|
||||
os.open(REDIRECT_TO, os.O_RDWR)
|
||||
os.dup2(0, 1)
|
||||
os.dup2(0, 2)
|
||||
Loading…
x
Reference in New Issue
Block a user