Skip to content

Commit

Permalink
modify: format black
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomáš Trval committed Oct 3, 2023
1 parent 77ff259 commit 5d5456c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flask_restx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
class FlaskCompatibilityWarning(DeprecationWarning):
pass


def merge(first, second):
"""
Recursively merges two dictionaries.
Expand Down Expand Up @@ -135,6 +136,7 @@ def import_check_view_func():
actual method body remaining the same in each flask version.
"""
import importlib.metadata

flask_version = importlib.metadata.version("flask").split(".")

def local_endpoint_from_view_func(view_func: typing.Callable) -> str:
Expand All @@ -143,6 +145,7 @@ def local_endpoint_from_view_func(view_func: typing.Callable) -> str:
"""
assert view_func is not None, "expected view func if endpoint is not provided."
return view_func.__name__

try:
if flask_version[0] == "1":
from flask.helpers import _endpoint_from_view_func
Expand All @@ -159,4 +162,3 @@ def local_endpoint_from_view_func(view_func: typing.Callable) -> str:
if _endpoint_from_view_func is None:
_endpoint_from_view_func = local_endpoint_from_view_func
return _endpoint_from_view_func

0 comments on commit 5d5456c

Please sign in to comment.