mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
mypy: Tweak a bit of syntax to avoid a mypy bug.
The error message, in relevant part: ``` zerver/templatetags/app_filters.py: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.560 File ".../site-packages/mypy/nodes.py", line 497, in accept return visitor.visit_func_def(self) File ".../site-packages/mypy/report.py", line 317, in visit_func_def assert start_indent is not None and start_indent > old_indent AssertionError: zerver/templatetags/app_filters.py: : note: use --pdb to drop into pdb ``` Seems mypy gets confused by the comment following the decorator.
This commit is contained in:
@@ -65,11 +65,11 @@ docs_without_macros = [
|
||||
"webhook-walkthrough.md",
|
||||
]
|
||||
|
||||
@register.filter(name='render_markdown_path', is_safe=True)
|
||||
# Much of the time, render_markdown_path is called with hashable
|
||||
# arguments, so this decorator is effective even though it only caches
|
||||
# the results when called if none of the arguments are unhashable.
|
||||
@ignore_unhashable_lru_cache(512)
|
||||
@register.filter(name='render_markdown_path', is_safe=True)
|
||||
def render_markdown_path(markdown_file_path, context=None):
|
||||
# type: (str, Optional[Dict[Any, Any]]) -> str
|
||||
"""Given a path to a markdown file, return the rendered html.
|
||||
|
Reference in New Issue
Block a user