[pypy-svn] r31996 - pypy/dist/pypy/module/rctime

rhymes at codespeak.net rhymes at codespeak.net
Tue Sep 5 11:29:34 CEST 2006


Author: rhymes
Date: Tue Sep  5 11:29:29 2006
New Revision: 31996

Modified:
   pypy/dist/pypy/module/rctime/interp_time.py
Log:
went back to math module because fmod breaks in linux.

Modified: pypy/dist/pypy/module/rctime/interp_time.py
==============================================================================
--- pypy/dist/pypy/module/rctime/interp_time.py	(original)
+++ pypy/dist/pypy/module/rctime/interp_time.py	Tue Sep  5 11:29:29 2006
@@ -5,6 +5,7 @@
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.baseobjspace import W_Root, ObjSpace
 from ctypes import *
+import math
 import os
 import sys
 
@@ -87,8 +88,7 @@
     Sleep.restype = None
 libc.strftime.argtypes = [c_char_p, size_t, c_char_p, POINTER(tm)]
 libc.strftime.restype = size_t
-libc.fmod.argtypes = [c_double, c_double]
-libc.fmod.restype = c_double
+
 
 def _init_accept2dyear():
     return (1, 0)[bool(os.getenv("PYTHONY2K"))]
@@ -266,7 +266,7 @@
 
     buf.tm_year = y - 1900
     buf.tm_mon = buf.tm_mon - 1
-    buf.tm_wday = int(libc.fmod((buf.tm_wday + 1), 7))
+    buf.tm_wday = int(math.fmod((buf.tm_wday + 1), 7))
     buf.tm_yday = buf.tm_yday - 1
 
     return buf



More information about the Pypy-commit mailing list