diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2014-02-09 13:27:18 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-02-09 13:27:18 -0500 |
| commit | cdc3b090d087825fe13d7b04846658d2bc8dae3f (patch) | |
| tree | 8d97ee1cdac664e260ea1e2bb203d99fffe5a415 /pkg_resources.py | |
| parent | e8e9a565526ac00b508da4717e9ae1f548083ae0 (diff) | |
| download | python-setuptools-git-cdc3b090d087825fe13d7b04846658d2bc8dae3f.tar.gz | |
Move comments
Diffstat (limited to 'pkg_resources.py')
| -rw-r--r-- | pkg_resources.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 73225e69..2f3fbd2e 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -2704,26 +2704,33 @@ def _initialize(g): _initialize(globals()) # Prepare the master working set and make the ``require()`` API available -_declare_state('object', working_set = WorkingSet()) +_declare_state('object', working_set=WorkingSet()) try: # Does the main program list any requirements? from __main__ import __requires__ except ImportError: - pass # No: just use the default working set based on sys.path + # No: just use the default working set based on sys.path + pass else: # Yes: ensure the requirements are met, by prefixing sys.path if necessary try: working_set.require(__requires__) - except VersionConflict: # try it without defaults already on sys.path - working_set = WorkingSet([]) # by starting with an empty path + except VersionConflict: + # try it without defaults already on sys.path + # by starting with an empty path + working_set = WorkingSet([]) for dist in working_set.resolve( parse_requirements(__requires__), Environment() ): working_set.add(dist) - for entry in sys.path: # add any missing entries from sys.path + + # add any missing entries from sys.path + for entry in sys.path: if entry not in working_set.entries: working_set.add_entry(entry) - sys.path[:] = working_set.entries # then copy back to sys.path + + # then copy back to sys.path + sys.path[:] = working_set.entries require = working_set.require iter_entry_points = working_set.iter_entry_points |
