diff --git a/doc/conf.py b/doc/conf.py index a131d01..0c229ae 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -139,13 +139,20 @@ "printindex": r"\def\twocolumn[#1]{#1}\printindex", } +# WORKAROUND: Python <3.12 +# Reusing the f-string's own quote character inside its expression - and a backslash in it - both need PEP 701. +# The escaped project name is built first, so this file still parses on Python 3.11. +# Replace by inlining it again: +# f"The {pythonProject.replace("_", r"\_")} Documentation", +latexProject = pythonProject.replace("_", r"\_") + # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ( master_doc, f"{pythonProject}.tex", - f"The {pythonProject.replace("_", r"\_")} Documentation", + f"The {latexProject} Documentation", "Patrick Lehmann", "manual" ), diff --git a/pyEDAA/OutputFilter/CLI/Configuration.py b/pyEDAA/OutputFilter/CLI/Configuration.py index beea625..f6d77dc 100644 --- a/pyEDAA/OutputFilter/CLI/Configuration.py +++ b/pyEDAA/OutputFilter/CLI/Configuration.py @@ -703,8 +703,14 @@ def _ParsePolicies(self, policies: CommentedMap) -> None: if policies["hasLatches"] == "error": self._hasLatches = Action.Error else: + # WORKAROUND: Python <3.12 + # Reusing the f-string's own quote character inside its expression needs PEP 701. On Python 3.11 + # this is a 'SyntaxError' raised at import, which takes the whole module with it. + # Replace by: + # ConfigurationWarning(f"tools.vivado.policies.hasLatches: Unknown value '{policies["hasLatches"]}'.")) + hasLatches = policies["hasLatches"] WarningCollector.Raise( - ConfigurationWarning(f"tools.vivado.policies.hasLatches: Unknown value '{policies["hasLatches"]}'.")) + ConfigurationWarning(f"tools.vivado.policies.hasLatches: Unknown value '{hasLatches}'.")) def _ParseRuleSetAction(self, actionConfig: Any) -> LineAction: if not isinstance(actionConfig, str):