diff --git a/src/instana/hooks/hook_uwsgi.py b/src/instana/hooks/hook_uwsgi.py index 6287a9f9..1995ffeb 100644 --- a/src/instana/hooks/hook_uwsgi.py +++ b/src/instana/hooks/hook_uwsgi.py @@ -44,8 +44,11 @@ def uwsgi_handle_fork() -> None: logger.debug( f"uWSGI --master={opt_master} --lazy-apps={opt_lazy_apps}: postfork hooks not applied" ) + except ImportError: logger.debug( "uwsgi hooks: decorators not available: likely not running under uWSGI" ) - pass + +except AttributeError: + logger.debug("uwsgi hooks: Running under uWSGI but decorators not available") diff --git a/src/instana/util/runtime.py b/src/instana/util/runtime.py index 832d37c2..a49cdfa3 100644 --- a/src/instana/util/runtime.py +++ b/src/instana/util/runtime.py @@ -135,7 +135,7 @@ def determine_service_name() -> str: uwsgi_type = "uWSGI worker%s" app_name = uwsgi_type % app_name - except ImportError: + except (ImportError, AttributeError): pass except Exception: logger.debug("non-fatal get_application_name: ", exc_info=True)