From ac625e9d3b0124843bdad4aae0ec6f9b0515fb15 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Sat, 3 Mar 2012 11:42:16 -0800 Subject: [PATCH] BUG: Correctly fix zip import for Python 3.2. 2to3 simply removes the itertools import line. --- skimage/transform/hough_transform.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/skimage/transform/hough_transform.py b/skimage/transform/hough_transform.py index 6a1fff8a..5bbe3b6c 100644 --- a/skimage/transform/hough_transform.py +++ b/skimage/transform/hough_transform.py @@ -1,9 +1,6 @@ __all__ = ['hough', 'probabilistic_hough'] -try: - from itertools import izip -except ImportError: - izip = zip +from itertools import izip as zip import numpy as np from ._hough_transform import _probabilistic_hough @@ -34,7 +31,7 @@ def _hough(img, theta=None): # x and y can be large, so we can't just broadcast to 2D # arrays as we may run out of memory. Instead we process # one vertical slice at a time. - for i, (cT, sT) in enumerate(izip(cos_theta, sin_theta)): + for i, (cT, sT) in enumerate(zip(cos_theta, sin_theta)): # compute the base distances distances = x * cT + y * sT