diff --git a/anki/__init__.py b/anki/__init__.py index d617bd801..90a90beac 100644 --- a/anki/__init__.py +++ b/anki/__init__.py @@ -4,8 +4,8 @@ import sys -if sys.version_info[0] < 3 or sys.version_info[1] < 6: - raise Exception("Anki requires Python 3.6+") +if sys.version_info[0] < 3 or sys.version_info[1] < 5: + raise Exception("Anki requires Python 3.5+") if sys.getfilesystemencoding().lower() in ("ascii", "ansi_x3.4-1968"): raise Exception("Anki requires a UTF-8 locale.") diff --git a/aqt/addons.py b/aqt/addons.py index d0c2f3684..a98524fef 100644 --- a/aqt/addons.py +++ b/aqt/addons.py @@ -330,7 +330,7 @@ class AddonsDialog(QDialog): if not addon: return if re.match(r"^\d+$", addon): - openLink(aqt.appShared + f"info/{addon}") + openLink(aqt.appShared + "info/{}".format(addon)) else: showWarning(_("Add-on was not downloaded from AnkiWeb.")) diff --git a/aqt/browser.py b/aqt/browser.py index 6fe2dcc6d..09a05d07c 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -1383,7 +1383,7 @@ where id in %s""" % ids2str(sf)) self._updatePreviewButtons() self._previewWeb.eval( - f"{func}({json.dumps(txt)},'{bodyclass}');") + "{}({},'{}');".format(func, json.dumps(txt), bodyclass)) def _onPreviewShowBothSides(self, toggle): self._previewBothSides = toggle diff --git a/aqt/errors.py b/aqt/errors.py index 182084a24..bccfdb90b 100644 --- a/aqt/errors.py +++ b/aqt/errors.py @@ -145,8 +145,9 @@ add-ons section of our support site. else: platname = "Linux" - return f"""\ -Anki {appVersion} Python {platform.python_version()} Qt {QT_VERSION_STR} PyQt {PYQT_VERSION_STR} -Platform: {platname} -Flags: frz={getattr(sys, "frozen", False)} ao={self.mw.addonManager.dirty} -""" + return """\ +Anki {} Python {} Qt {} PyQt {} +Platform: {} +Flags: frz={} ao={} +""".format(appVersion, platform.python_version(), QT_VERSION_STR, PYQT_VERSION_STR, platname, + getattr(sys, "frozen", False), self.mw.addonManager.dirty) diff --git a/aqt/main.py b/aqt/main.py index 9c652e90a..56fe1ab42 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -288,7 +288,7 @@ close the profile or restart Anki.""")) if getattr(w, "silentlyClose", None): w.close() else: - showWarning(f"Window should have been closed: {w}") + showWarning("Window should have been closed: {}".format(w)) def unloadProfileAndExit(self): self.unloadProfile(self.cleanupAndExit) diff --git a/aqt/reviewer.py b/aqt/reviewer.py index 2f216c532..5f1b2706b 100644 --- a/aqt/reviewer.py +++ b/aqt/reviewer.py @@ -119,12 +119,12 @@ class Reviewer: def revHtml(self): extra = self.mw.col.conf.get("reviewExtra", "") - return f""" + return """