Skip to content

Commit

Permalink
refactor propagators' initialization to accommodate Nuitka compilatio…
Browse files Browse the repository at this point in the history
…n to C++ code
  • Loading branch information
sorinansys committed Feb 23, 2023
1 parent 2351d9b commit 1b1daa7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions opentelemetry-api/src/opentelemetry/propagate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ def inject(
for propagator in environ_propagators.split(","):
propagator = propagator.strip()
try:
propagators.append( # type: ignore
next( # type: ignore
iter_entry_points("opentelemetry_propagator", propagator)
).load()()
)
for entry in iter_entry_points("opentelemetry_propagator"):
if entry.name==propagator:
propagators.append( # type: ignore
entry.load()()
)
break
except Exception: # pylint: disable=broad-except
logger.exception(
"Failed to load configured propagator `%s`", propagator
Expand Down

0 comments on commit 1b1daa7

Please sign in to comment.