some fixes discovered with pyflakes

This commit is contained in:
benoitc 2010-05-23 00:44:53 +02:00
parent 9e203e0637
commit f8fac58d73
6 changed files with 5 additions and 12 deletions

View File

@ -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):
"""\

View File

@ -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

View File

@ -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):

View File

@ -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

View File

@ -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):

View File

@ -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)