[pypy-svn] r9992 - pypy/dist/pypy/lib

tismer at codespeak.net tismer at codespeak.net
Mon Mar 21 17:00:58 CET 2005


Author: tismer
Date: Mon Mar 21 17:00:57 2005
New Revision: 9992

Modified:
   pypy/dist/pypy/lib/struct.py
Log:
special-cased 0.0 which is represented as zero string

Modified: pypy/dist/pypy/lib/struct.py
==============================================================================
--- pypy/dist/pypy/lib/struct.py	(original)
+++ pypy/dist/pypy/lib/struct.py	Mon Mar 21 17:00:57 2005
@@ -60,7 +60,7 @@
     bytes = [ord(b) for b in data[index:index+size]]
     if len(bytes) != size:
         raise StructError,"Not enough data to unpack"
-    if min(bytes) == 0:
+    if max(bytes) == 0:
         return 0.0
     if le == 'big':
         bytes.reverse()



More information about the Pypy-commit mailing list