[pypy-svn] r55428 - pypy/branch/build-external/pypy/module/rctime
afa at codespeak.net
afa at codespeak.net
Fri May 30 18:20:58 CEST 2008
Author: afa
Date: Fri May 30 18:20:56 2008
New Revision: 55428
Modified:
pypy/branch/build-external/pypy/module/rctime/__init__.py
pypy/branch/build-external/pypy/module/rctime/interp_time.py
Log:
initialize timezone info when the module loads, not when the module is translated
Modified: pypy/branch/build-external/pypy/module/rctime/__init__.py
==============================================================================
--- pypy/branch/build-external/pypy/module/rctime/__init__.py (original)
+++ pypy/branch/build-external/pypy/module/rctime/__init__.py Fri May 30 18:20:56 2008
@@ -24,20 +24,19 @@
def buildloaders(cls):
from pypy.module.rctime import interp_time
- import os
# this machinery is needed to expose constants
# that have to be initialized one time only
Module.interpleveldefs["accept2dyear"] = 'space.wrap(%r)' %\
interp_time._init_accept2dyear()
-
- timezone, daylight, tzname, altzone = interp_time._init_timezone()
- Module.interpleveldefs['timezone'] = 'space.wrap(%r)' % timezone
- Module.interpleveldefs['daylight'] = 'space.wrap(%r)' % daylight
+
+ Module.interpleveldefs['timezone'] = 'space.wrap(0)'
+ Module.interpleveldefs['daylight'] = 'space.wrap(0)'
Module.interpleveldefs['tzname'] = \
- 'space.newlist([space.wrap(%r), space.wrap(%r)])' % tuple(tzname)
- Module.interpleveldefs['altzone'] = 'space.wrap(%r)' % altzone
+ 'space.newlist([space.wrap(""), space.wrap("")])'
+ Module.interpleveldefs['altzone'] = 'space.wrap(0)'
+
super(Module, cls).buildloaders()
buildloaders = classmethod(buildloaders)
@@ -46,3 +45,7 @@
'__doc__': 'app_time.__doc__',
'strptime': 'app_time.strptime',
}
+
+ def startup(self, space):
+ from pypy.module.rctime import interp_time
+ interp_time.tzset(space)
Modified: pypy/branch/build-external/pypy/module/rctime/interp_time.py
==============================================================================
--- pypy/branch/build-external/pypy/module/rctime/interp_time.py (original)
+++ pypy/branch/build-external/pypy/module/rctime/interp_time.py Fri May 30 18:20:56 2008
@@ -405,7 +405,7 @@
_set_module_object(space, "timezone", space.wrap(timezone))
_set_module_object(space, 'daylight', space.wrap(daylight))
tzname_w = [space.wrap(tzname[0]), space.wrap(tzname[1])]
- _set_module_object(space, 'tzname', space.newtuple(tzname_w))
+ _set_module_object(space, 'tzname', space.newlist(tzname_w))
_set_module_object(space, 'altzone', space.wrap(altzone))
tzset.unwrap_spec = [ObjSpace]
More information about the Pypy-commit
mailing list