Skip to content

Commit 18aa074

Browse files
committed
fix: some custom builds don't have __file__
Meta asked for this.
1 parent 8c5bf65 commit 18aa074

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coverage/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
try:
3131
# Use the C extension code when we can, for speed.
3232
import coverage.tracer
33-
CTRACER_FILE: str | None = coverage.tracer.__file__
33+
CTRACER_FILE: str | None = getattr(coverage.tracer, "__file__", "unknown")
3434
except ImportError as imp_err:
3535
# Couldn't import the C extension, maybe it isn't built.
3636
# We still need to check the environment variable directly here,

0 commit comments

Comments
 (0)