Skip to content

Commit d40aff8

Browse files
committed
fix format
1 parent e314030 commit d40aff8

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/instrument_middleware.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ def instrument_middleware_classes(
4444
try:
4545
cls_or_func = import_string(mw_path)
4646
except ImportError:
47-
_logger.debug(
48-
"Could not import middleware %s, skipping", mw_path
49-
)
47+
_logger.debug("Could not import middleware %s, skipping", mw_path)
5048
continue
5149

5250
if not inspect.isclass(cls_or_func):
@@ -89,7 +87,9 @@ def _wrap_middleware_mixin(tracer: Tracer) -> None:
8987

9088
def _make_mixin_call_wrapper(tracer: Tracer):
9189
def _traced_call(wrapped, instance, args, kwargs):
92-
if getattr(instance, "async_mode", False) or getattr(instance, "is_async", False):
90+
if getattr(instance, "async_mode", False) or getattr(
91+
instance, "is_async", False
92+
):
9393
return wrapped(*args, **kwargs)
9494
middleware_name = type(instance).__qualname__
9595
with tracer.start_as_current_span(
@@ -116,9 +116,7 @@ async def _traced_acall(wrapped, instance, args, kwargs):
116116
# -- Category 2: Pure new-style class middleware --
117117

118118

119-
def _wrap_newstyle_middleware(
120-
mw_path: str, cls: type, tracer: Tracer
121-
) -> None:
119+
def _wrap_newstyle_middleware(mw_path: str, cls: type, tracer: Tracer) -> None:
122120
module_path, class_name = mw_path.rsplit(".", 1)
123121

124122
wrap_function_wrapper(

0 commit comments

Comments
 (0)