From 91cd6c6288dae389818cc40de0d223cd9a16363d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 3 Jul 2017 23:28:07 +0200 Subject: [PATCH] Fix Python 3.4 circular imports --- qutebrowser/config/config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index ed6b126ef..a1a98fa4c 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -28,9 +28,9 @@ from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject, QUrl 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 @@ class KeyConfig: 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 @@ class StyleSheetObserver(QObject): 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)