Skip to content

Commit

Permalink
fix issue #143. unnecessary list().
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Mar 6, 2011
1 parent c21578d commit dbc61f3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions gunicorn/app/base.py
Expand Up @@ -60,7 +60,7 @@ def load_config(self):

# Load up the any app specific configuration
if cfg:
for k, v in list(cfg.items()):
for k, v in cfg.items():
self.cfg.set(k.lower(), v)

# Load up the config file if its found.
Expand All @@ -79,7 +79,7 @@ def load_config(self):
traceback.print_exc()
sys.exit(1)

for k, v in list(cfg.items()):
for k, v in cfg.items():
# Ignore unknown names
if k not in self.cfg.settings:
continue
Expand All @@ -91,7 +91,7 @@ def load_config(self):

# Lastly, update the configuration with any command line
# settings.
for k, v in list(opts.__dict__.items()):
for k, v in opts.__dict__.items():
if v is None:
continue
self.cfg.set(k.lower(), v)
Expand Down
4 changes: 2 additions & 2 deletions gunicorn/app/djangoapp.py
Expand Up @@ -125,7 +125,7 @@ def load_config(self):
traceback.print_exc()
sys.exit(1)

for k, v in list(cfg.items()):
for k, v in cfg.items():
# Ignore unknown names
if k not in self.cfg.settings:
continue
Expand All @@ -135,7 +135,7 @@ def load_config(self):
sys.stderr.write("Invalid value for %s: %s\n\n" % (k, v))
raise

for k, v in list(self.options.items()):
for k, v in self.options.items():
if k.lower() in self.cfg.settings and v is not None:
self.cfg.set(k.lower(), v)

Expand Down
4 changes: 2 additions & 2 deletions gunicorn/app/pasterapp.py
Expand Up @@ -110,12 +110,12 @@ def __init__(self, app, gcfg=None, host="127.0.0.1", port=None, *args, **kwargs)
cfg["bind"] = bind

if gcfg:
for k, v in list(gcfg.items()):
for k, v in gcfg.items():
cfg[k] = v
cfg["default_proc_name"] = cfg['__file__']

try:
for k, v in list(cfg.items()):
for k, v in cfg.items():
if k.lower() in self.cfg.settings and v is not None:
self.cfg.set(k.lower(), v)
except Exception, e:
Expand Down
2 changes: 1 addition & 1 deletion gunicorn/arbiter.py
Expand Up @@ -373,7 +373,7 @@ def murder_workers(self):
"""\
Kill unused/idle workers
"""
for (pid, worker) in list(self.WORKERS.items()):
for (pid, worker) in self.WORKERS.items():
try:
diff = time.time() - os.fstat(worker.tmp.fileno()).st_ctime
if diff <= self.timeout:
Expand Down

0 comments on commit dbc61f3

Please sign in to comment.