[Python-checkins] r52212 - python/trunk/Lib/colorsys.py

armin.rigo python-checkins at python.org
Fri Oct 6 18:33:22 CEST 2006


Author: armin.rigo
Date: Fri Oct  6 18:33:22 2006
New Revision: 52212

Modified:
   python/trunk/Lib/colorsys.py
Log:
A very minor bug fix: this code looks like it is designed to accept
any hue value and do the modulo itself, except it doesn't quite do
it in all cases.  At least, the "cannot get here" comment was wrong.


Modified: python/trunk/Lib/colorsys.py
==============================================================================
--- python/trunk/Lib/colorsys.py	(original)
+++ python/trunk/Lib/colorsys.py	Fri Oct  6 18:33:22 2006
@@ -117,7 +117,8 @@
     p = v*(1.0 - s)
     q = v*(1.0 - s*f)
     t = v*(1.0 - s*(1.0-f))
-    if i%6 == 0: return v, t, p
+    i = i%6
+    if i == 0: return v, t, p
     if i == 1: return q, v, p
     if i == 2: return p, v, t
     if i == 3: return p, q, v


More information about the Python-checkins mailing list