From ca9749b3c9b6ec565686347db0e47cd272a4c524 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 29 Jul 2016 10:09:43 +0200 Subject: [PATCH] fix NameError when initial working_set is empty by defining dist so there's something to delete --- pkg_resources/__init__.py | 1 + 1 file changed, 1 insertion(+) 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