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 errno
import fcntl
import logging
import os
import select
import signal
import socket
import sys
import tempfile
import time
@ -59,7 +57,7 @@ class Arbiter(object):
a = os.stat(os.environ('PWD'))
b = os.stat(os.getcwd())
if a.ino == b.ino and a.dev == b.dev:
cwd = pwd
cwd = os.environ('PWD')
else:
cwd = os.getcwd()
except:

View File

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

View File

@ -10,7 +10,6 @@ import optparse as op
import os
import pwd
import pkg_resources
import re
import sys
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)
else:
os.setpgrp()
set_owner_process(opts.user, opts.group)
set_owner_process(user, group)
arbiter.run()
def run():
@ -225,9 +224,6 @@ def run_django():
def run_paster():
from paste.deploy import loadapp, loadwsgi
_scheme_re = re.compile(r'^[a-z][a-z]+:', re.I)
def get_app(parser, opts, args):
if len(args) != 1:
parser.error("No application name specified.")

View File

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

View File

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