diff options
| author | Michael Merickel <michael@merickel.org> | 2014-11-21 15:57:08 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2014-12-26 22:49:19 -0600 |
| commit | 5d2302a2b8d968245a123e54a8f01cd62c97cf69 (patch) | |
| tree | 643dd3c07917480032b21651f82775cf496d635c | |
| parent | 2253647075ace9e99171f3e227f5debbcafdd8b8 (diff) | |
| download | pyramid-5d2302a2b8d968245a123e54a8f01cd62c97cf69.tar.gz pyramid-5d2302a2b8d968245a123e54a8f01cd62c97cf69.tar.bz2 pyramid-5d2302a2b8d968245a123e54a8f01cd62c97cf69.zip | |
izip_longest is not valid on py3
| -rw-r--r-- | pyramid/compat.py | 4 | ||||
| -rw-r--r-- | pyramid/config/__init__.py | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/pyramid/compat.py b/pyramid/compat.py index bfa345b88..301984749 100644 --- a/pyramid/compat.py +++ b/pyramid/compat.py @@ -244,3 +244,7 @@ else: def is_bound_method(ob): return inspect.ismethod(ob) and getattr(ob, im_self, None) is not None +if PY3: # pragma: no cover + from itertools import zip_longest +else: + from itertools import izip_longest as zip_longest diff --git a/pyramid/config/__init__.py b/pyramid/config/__init__.py index 83683daeb..e907cbb14 100644 --- a/pyramid/config/__init__.py +++ b/pyramid/config/__init__.py @@ -23,6 +23,7 @@ from pyramid.compat import ( text_, reraise, string_types, + zip_longest, ) from pyramid.events import ApplicationCreated @@ -1089,7 +1090,7 @@ class ActionState(object): # re-entrant action because it scheduled the action *after* it # should have been executed (as defined by the action order) def resume(actions): - for a, b in itertools.izip_longest(actions, executed_actions): + for a, b in zip_longest(actions, executed_actions): if b is None and a is not None: # common case is that we are executing every action yield a |
