Skip to content

Commit

Permalink
Rely on short-circuit in 'or' rather than building a separate iterable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 7, 2016
1 parent f664385 commit 8ce73d4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import email.parser
import tempfile
import textwrap
import itertools
from pkgutil import get_importer

try:
Expand Down Expand Up @@ -991,13 +990,7 @@ def markers_pass(self, req):
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):
Expand Down

0 comments on commit 8ce73d4

Please sign in to comment.