Skip to content

Commit

Permalink
Fix superset cli for python3 (#1760)
Browse files Browse the repository at this point in the history
* Fix superset cli for python3

dict.iteritems() has been removed since dict.items() returns an
iterable in python3. Shouldn't be a big deal for python2 to load
all the data into a list.

Fix #1756

* bin/superset: avoid some work when reading config

We don't need to unpack and then pack again a dictionary.
  • Loading branch information
xrmx authored and mistercrunch committed Dec 4, 2016
1 parent c4e943a commit abd0974
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions superset/bin/superset
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class GunicornSupersetApplication(gunicorn.app.base.BaseApplication):
super(GunicornSupersetApplication, self).__init__()

def load_config(self):
config = dict([(key, value) for key, value in self.options.iteritems()
if key in self.cfg.settings and value is not None])
for key, value in config.iteritems():
config = [(key, value) for key, value in self.options.items()
if key in self.cfg.settings and value is not None]
for key, value in config:
self.cfg.set(key.lower(), value)

def load(self):
Expand Down

0 comments on commit abd0974

Please sign in to comment.