Skip to content

Commit

Permalink
Enable automatic formatting for sphinx/ext/ifconfig.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Dec 22, 2024
1 parent ff8bb72 commit 437a31d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ exclude = [
"sphinx/domains/python/_object.py",
"sphinx/domains/rst.py",
"sphinx/domains/std/__init__.py",
"sphinx/ext/ifconfig.py",
"sphinx/ext/imgconverter.py",
"sphinx/ext/imgmath.py",
"sphinx/ext/inheritance_diagram.py",
Expand Down
8 changes: 4 additions & 4 deletions sphinx/ext/ifconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class ifconfig(nodes.Element):


class IfConfig(SphinxDirective):

has_content = True
required_arguments = 1
optional_arguments = 0
Expand All @@ -61,10 +60,11 @@ def process_ifconfig_nodes(app: Sphinx, doctree: nodes.document, docname: str) -
except Exception as err:
# handle exceptions in a clean fashion
from traceback import format_exception_only

msg = ''.join(format_exception_only(err.__class__, err))
newnode = doctree.reporter.error('Exception occurred in '
'ifconfig expression: \n%s' %
msg, base_node=node)
newnode = doctree.reporter.error(
f'Exception occurred in ifconfig expression: \n{msg}', base_node=node
)
node.replace_self(newnode)
else:
if not res:
Expand Down

0 comments on commit 437a31d

Please sign in to comment.