Skip to content

Commit

Permalink
Use generator expression to manage the scope of 'dist'
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 4, 2016
1 parent 24e0c48 commit f783aa3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f783aa3

Please sign in to comment.