remove unused import/var and some fixes

This commit is contained in:
Benoit Chesneau 2010-02-16 14:24:40 +01:00
parent d54c832fbc
commit 87336be46b
5 changed files with 5 additions and 13 deletions

View File

@ -7,12 +7,10 @@ from __future__ import with_statement
import copy import copy
import errno import errno
import fcntl
import logging import logging
import os import os
import select import select
import signal import signal
import socket
import sys import sys
import tempfile import tempfile
import time import time
@ -59,7 +57,7 @@ class Arbiter(object):
a = os.stat(os.environ('PWD')) a = os.stat(os.environ('PWD'))
b = os.stat(os.getcwd()) b = os.stat(os.getcwd())
if a.ino == b.ino and a.dev == b.dev: if a.ino == b.ino and a.dev == b.dev:
cwd = pwd cwd = os.environ('PWD')
else: else:
cwd = os.getcwd() cwd = os.getcwd()
except: except:

View File

@ -117,6 +117,4 @@ class Config(object):
def before_exec(self, *args): def before_exec(self, *args):
return self._hook("before_exec", *args) return self._hook("before_exec", *args)

View File

@ -10,7 +10,6 @@ import optparse as op
import os import os
import pwd import pwd
import pkg_resources import pkg_resources
import re
import sys import sys
from gunicorn.arbiter import Arbiter from gunicorn.arbiter import Arbiter
@ -168,7 +167,7 @@ def paste_server(app, global_conf=None, host="127.0.0.1", port=None,
daemonize(umask) daemonize(umask)
else: else:
os.setpgrp() os.setpgrp()
set_owner_process(opts.user, opts.group) set_owner_process(user, group)
arbiter.run() arbiter.run()
def run(): def run():
@ -225,9 +224,6 @@ def run_django():
def run_paster(): def run_paster():
from paste.deploy import loadapp, loadwsgi from paste.deploy import loadapp, loadwsgi
_scheme_re = re.compile(r'^[a-z][a-z]+:', re.I)
def get_app(parser, opts, args): def get_app(parser, opts, args):
if len(args) != 1: if len(args) != 1:
parser.error("No application name specified.") parser.error("No application name specified.")

View File

@ -158,7 +158,7 @@ class Worker(object):
try: try:
# Last ditch attempt to notify the client of an error. # Last ditch attempt to notify the client of an error.
mesg = "HTTP/1.0 500 Internal Server Error\r\n\r\n" mesg = "HTTP/1.0 500 Internal Server Error\r\n\r\n"
write_nonblock(sock, mesg) util.write_nonblock(client, mesg)
except: except:
pass pass
finally: finally:

View File

@ -97,7 +97,7 @@ def hasnot(a, b):
def raises(exctype, func, *args, **kwargs): def raises(exctype, func, *args, **kwargs):
try: try:
func(*args, **kwargs) func(*args, **kwargs)
except exctype, inst: except exctype:
pass pass
else: else:
func_name = getattr(func, "func_name", "<builtin_function>") func_name = getattr(func, "func_name", "<builtin_function>")