diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2016-04-07 22:24:53 +0100 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-04-07 22:24:53 +0100 |
| commit | 8ce73d4450eb646b80c004e57b82ed9eabe24f35 (patch) | |
| tree | 1cc6a57c5e9f5c87cbccf6deeb7fda00bd73d571 | |
| parent | f664385be2051cd135ad52e1563993945e0abe10 (diff) | |
| download | python-setuptools-git-8ce73d4450eb646b80c004e57b82ed9eabe24f35.tar.gz | |
Rely on short-circuit in 'or' rather than building a separate iterable.
| -rw-r--r-- | pkg_resources/__init__.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 04064d5a..ab48cf7a 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -35,7 +35,6 @@ import plistlib import email.parser import tempfile import textwrap -import itertools from pkgutil import get_importer try: @@ -991,13 +990,7 @@ class _ReqExtras(dict): req.marker.evaluate({'extra': extra}) for extra in self.get(req, ()) ) - # set up a late-evaluated simple marker evaluation. - simple_eval = ( - req.marker.evaluate() - for _ in (None,) - ) - evals = itertools.chain(extra_evals, simple_eval) - return not req.marker or any(evals) + return not req.marker or any(extra_evals) or req.marker.evaluate() class Environment(object): |
