diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 6d4727348f..9f0ea6ec5c 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -2981,6 +2981,7 @@ def _initialize_master_working_set(): # ensure that all distributions added to the working set in the future # (e.g. by calling ``require()``) will get activated as well, # with higher priority (replace=True). + dist = None # ensure dist is defined for del dist below for dist in working_set: dist.activate(replace=False) del dist