File tree Expand file tree Collapse file tree 1 file changed +18
-18
lines changed
src/mkdocstrings_handlers/python Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -474,25 +474,25 @@ def do_get_template(env: Environment, obj: str | Object) -> str | Template:
474474 template = env .get_template (f"{ name } .html" )
475475 except TemplateNotFound :
476476 return f"{ name } .html.jinja"
477- else :
478- # TODO: Remove once support for Python 3.8 is dropped.
479- if sys .version_info < (3 , 9 ):
480- try :
481- Path (template .filename ).relative_to (Path (__file__ ).parent ) # type: ignore[arg-type]
482- except ValueError :
483- our_template = False
484- else :
485- our_template = True
477+ # TODO: Remove once support for Python 3.8 is dropped.
478+ if sys .version_info < (3 , 9 ):
479+ try :
480+ Path (template .filename ).relative_to (Path (__file__ ).parent ) # type: ignore[arg-type]
481+ except ValueError :
482+ our_template = False
486483 else :
487- our_template = Path (template .filename ).is_relative_to (Path (__file__ ).parent ) # type: ignore[arg-type]
488- if not our_template :
489- # TODO: Switch to a warning log after some time.
490- logger .info (
491- f"DeprecationWarning: Overriding '{ name } .html' is deprecated, override '{ name } .html.jinja' instead. "
492- "After some time, this message will be logged as a warning, causing strict builds to fail." ,
493- once = True ,
494- )
495- return f"{ name } .html"
484+ our_template = True
485+ else :
486+ our_template = Path (template .filename ).is_relative_to (Path (__file__ ).parent ) # type: ignore[arg-type]
487+ if our_template :
488+ return f"{ name } .html.jinja"
489+ # TODO: Switch to a warning log after some time.
490+ logger .info (
491+ f"DeprecationWarning: Overriding '{ name } .html' is deprecated, override '{ name } .html.jinja' instead. "
492+ "After some time, this message will be logged as a warning, causing strict builds to fail." ,
493+ once = True ,
494+ )
495+ return f"{ name } .html"
496496
497497
498498@pass_context
You can’t perform that action at this time.
0 commit comments