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 | 30839946329202ee9c6060484798fe50830e8a81 (patch) | |
tree | 8120dd4b5d75e64cd19f44e8ef314e5014b992f4 /pkg_resources.py | |
parent | 1d2f7c733babde294d3d560a801b680806fb881a (diff) | |
download | python-setuptools-bitbucket-30839946329202ee9c6060484798fe50830e8a81.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 |