Skip jaeger_client import when tracing is disabled
Problem
When running gluetool/citool on Python 3.12, the jaeger_client import chain (jaeger_client → tornado) crashes with AttributeError because collections.MutableMapping was removed in Python 3.10+ (moved to collections.abc.MutableMapping).
The previous code only caught ImportError, so the AttributeError from tornado propagated and crashed gluetool at import time.
Solution
- Skip the
jaeger_clientimport entirely whenGLUETOOL_TRACING_DISABLEis set — there is no reason to load the tracing client when tracing is disabled - Catch
AttributeErrorin addition toImportError, so incompatible transitive dependencies (like old tornado) gracefully degrade instead of crashing gluetool
Related
Discovered while migrating gluetool-modules to Python 3.12 (MR gluetool-modules!1023 (merged)).
Assisted-by: Claude Code
Edited by Miroslav Vadkerti