Permalink
Browse files

Fix Python 3.4 circular imports

  • Loading branch information...
The-Compiler committed Jul 3, 2017
1 parent 9db4a8c commit 91cd6c6288dae389818cc40de0d223cd9a16363d
Showing with 6 additions and 2 deletions.
  1. +6 −2 qutebrowser/config/config.py
@@ -28,9 +28,9 @@

from qutebrowser.config import configdata, configexc, configtypes, configfiles
from qutebrowser.utils import (utils, objreg, message, standarddir, log,
usertypes, jinja)
usertypes)
from qutebrowser.misc import objects
from qutebrowser.commands import cmdexc, cmdutils, runners
from qutebrowser.commands import cmdexc, cmdutils


# An easy way to access the config from other code via config.val.foo
@@ -174,6 +174,8 @@ def get_command(self, key, mode):

def bind(self, key, command, *, mode, force=False, save_yaml=False):
"""Add a new binding from key to command."""
# Doing this here to work around a Python 3.4 circular import
from qutebrowser.commands import runners
key = self._prepare(key, mode)

parser = runners.CommandParser()
@@ -574,6 +576,8 @@ def _get_stylesheet(self):
Return:
The formatted template as string.
"""
# Imported here to avoid a Python 3.4 circular import
from qutebrowser.utils import jinja
template = jinja.environment.from_string(self._stylesheet)
return template.render(conf=val)

0 comments on commit 91cd6c6

Please sign in to comment.