Skip to content

Commit cd3c855

Browse files
committed
Auto Instrumentation sitecustomize: allowing unset PYTHONPATH
For edge cases where PYTHONPATH is not set at all
1 parent 3deb6b9 commit cd3c855

File tree

1 file changed

+1
-1
lines changed
  • opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation

1 file changed

+1
-1
lines changed

opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
def initialize():
3030
# prevents auto-instrumentation of subprocesses if code execs another python process
3131
environ["PYTHONPATH"] = _python_path_without_directory(
32-
environ["PYTHONPATH"], dirname(abspath(__file__)), pathsep
32+
environ.get("PYTHONPATH", ""), dirname(abspath(__file__)), pathsep
3333
)
3434

3535
try:

0 commit comments

Comments
 (0)