summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-12-04 11:04:10 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-12-04 11:04:10 -0500
commitf783aa36971d78b293fb5d627d1aacd6dbd49afc (patch)
tree71e44d6d0e4257939b24f2e7cb9c261c31d46ad1
parent24e0c48846956d55af3a191bed02e3ac84595fb2 (diff)
downloadpython-setuptools-git-f783aa36971d78b293fb5d627d1aacd6dbd49afc.tar.gz
Use generator expression to manage the scope of 'dist'
-rw-r--r--pkg_resources/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 3be41752..92503288 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -3038,10 +3038,10 @@ 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:
+ tuple(
dist.activate(replace=False)
- del dist
+ for dist in working_set
+ )
add_activation_listener(lambda dist: dist.activate(replace=True), existing=False)
working_set.entries = []
# match order