[ python-Bugs-1345263 ] colorsys tests, bug in frange

SourceForge.net noreply at sourceforge.net
Wed Nov 2 16:24:08 CET 2005


Bugs item #1345263, was opened at 2005-11-01 21:50
Message generated for change (Comment added) made by titanstar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1345263&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Rune Holm (titanstar)
Assigned to: Neal Norwitz (nnorwitz)
Summary: colorsys tests, bug in frange

Initial Comment:
The frange() function in Lib/test/test_colorsys.py generates incorrect 
ranges, making the tests less comprehensive than expected.
The following patch fixes the problem:

$ svn diff Lib/test/test_colorsys.py
Index: Lib/test/test_colorsys.py
=================================================
==================
--- Lib/test/test_colorsys.py   (revision 41365)
+++ Lib/test/test_colorsys.py   (working copy)
@@ -4,7 +4,7 @@
 def frange(start, stop, step):
     while start <= stop:
         yield start
-        start += stop
+        start += step
 
 class ColorsysTest(unittest.TestCase):
 


----------------------------------------------------------------------

>Comment By: Rune Holm (titanstar)
Date: 2005-11-02 16:24

Message:
Logged In: YES 
user_id=858364

Well, I was hacking away on the parser, and accidentally broke the code 
that emits bytecode for while statements, which incidentally turned the 
while loop in question into an infinite loop. That tends to make you read the 
turned-buggy code extra carefully :)



----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2005-11-02 07:02

Message:
Logged In: YES 
user_id=33168

Thanks!  I have no idea how you spotted that.

Committed revision 41369.
Committed revision 41370. (2.4)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1345263&group_id=5470


More information about the Python-bugs-list mailing list