|
5 | 5 | import sys |
6 | 6 | import locale |
7 | 7 | from itertools import chain |
| 8 | +from six import iterkeys, iteritems |
| 9 | + |
8 | 10 | from bpython.keys import cli_key_dispatch as key_dispatch |
9 | 11 | from bpython.autocomplete import SIMPLE as default_completion |
10 | 12 | import bpython.autocomplete |
@@ -48,11 +50,11 @@ def default_config_path(): |
48 | 50 |
|
49 | 51 |
|
50 | 52 | def fill_config_with_default_values(config, default_values): |
51 | | - for section in default_values.iterkeys(): |
| 53 | + for section in iterkeys(default_values): |
52 | 54 | if not config.has_section(section): |
53 | 55 | config.add_section(section) |
54 | 56 |
|
55 | | - for (opt, val) in default_values[section].iteritems(): |
| 57 | + for (opt, val) in iteritems(default_values[section]): |
56 | 58 | if not config.has_option(section, opt): |
57 | 59 | config.set(section, opt, str(val)) |
58 | 60 |
|
@@ -130,7 +132,7 @@ def loadini(struct, configfile): |
130 | 132 | }} |
131 | 133 |
|
132 | 134 | default_keys_to_commands = dict((value, key) for (key, value) |
133 | | - in defaults['keyboard'].iteritems()) |
| 135 | + in iteritems(defaults['keyboard'])) |
134 | 136 |
|
135 | 137 | fill_config_with_default_values(config, defaults) |
136 | 138 | if not config.read(config_path): |
@@ -307,6 +309,6 @@ def load_theme(struct, path, colors, default_colors): |
307 | 309 | colors[k] = theme.get('interface', k) |
308 | 310 |
|
309 | 311 | # Check against default theme to see if all values are defined |
310 | | - for k, v in default_colors.iteritems(): |
| 312 | + for k, v in iteritems(default_colors): |
311 | 313 | if k not in colors: |
312 | 314 | colors[k] = v |
0 commit comments