DataDog / dd-trace-py

Datadog Python APM Client
https://ddtrace.readthedocs.io/
Other
542 stars 411 forks source link

chore: restore module loader after import #9638

Closed P403n1x87 closed 3 months ago

P403n1x87 commented 3 months ago

We restore the original loader after a module has been imported. We only need our custom chained loader while the module is being imported to allow the import hooks to be triggered at the right time. There is no need for the custom loader once the module is fully imported.

Checklist

Reviewer Checklist

brettlangdon commented 3 months ago

is there a test for this? what scenario do we want this to happen?

P403n1x87 commented 3 months ago

is there a test for this? what scenario do we want this to happen?

This change was aimed at making some of the framework tests run again

gnufede commented 3 months ago

is there a test for this? what scenario do we want this to happen?

Fix this kind of errors that happen when pip is instrumented