From dbc61f310e6d3d24c0524b6cd2ae46f6ea0b4723 Mon Sep 17 00:00:00 2001 From: benoitc Date: Sun, 6 Mar 2011 10:23:58 +0100 Subject: [PATCH] fix issue #143. unnecessary list(). --- gunicorn/app/base.py | 6 +++--- gunicorn/app/djangoapp.py | 4 ++-- gunicorn/app/pasterapp.py | 4 ++-- gunicorn/arbiter.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gunicorn/app/base.py b/gunicorn/app/base.py index 6062117e..4bc4b21e 100644 --- a/gunicorn/app/base.py +++ b/gunicorn/app/base.py @@ -60,7 +60,7 @@ class Application(object): # 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. @@ -79,7 +79,7 @@ class Application(object): 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 @@ -91,7 +91,7 @@ class Application(object): # 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) diff --git a/gunicorn/app/djangoapp.py b/gunicorn/app/djangoapp.py index e8cd81b4..6ea6608f 100644 --- a/gunicorn/app/djangoapp.py +++ b/gunicorn/app/djangoapp.py @@ -125,7 +125,7 @@ class DjangoApplicationCommand(Application): 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 @@ -135,7 +135,7 @@ class DjangoApplicationCommand(Application): 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) diff --git a/gunicorn/app/pasterapp.py b/gunicorn/app/pasterapp.py index 38847818..0d6c7444 100644 --- a/gunicorn/app/pasterapp.py +++ b/gunicorn/app/pasterapp.py @@ -110,12 +110,12 @@ class PasterServerApplication(PasterBaseApplication): 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: diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 0ee2c665..05f6a2e2 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -373,7 +373,7 @@ class Arbiter(object): """\ 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: