This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: colorsys tests, bug in frange
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: nnorwitz, titanstar
Priority: normal Keywords:

Created on 2005-11-01 20:50 by titanstar, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg26773 - (view) Author: Rune Holm (titanstar) Date: 2005-11-01 20:50
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):
 
msg26774 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-11-02 06:02
Logged In: YES 
user_id=33168

Thanks!  I have no idea how you spotted that.

Committed revision 41369.
Committed revision 41370. (2.4)
msg26775 - (view) Author: Rune Holm (titanstar) Date: 2005-11-02 15:24
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 :)

History
Date User Action Args
2022-04-11 14:56:13adminsetgithub: 42539
2005-11-01 20:50:36titanstarcreate