Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3.5
Changeset: r90908:4dec46cc728e
Date: 2017-04-01 22:00 +0200
http://bitbucket.org/pypy/pypy/changeset/4dec46cc728e/

Log:    Fix translation for platforms without tm_zone

diff --git a/pypy/module/time/interp_time.py b/pypy/module/time/interp_time.py
--- a/pypy/module/time/interp_time.py
+++ b/pypy/module/time/interp_time.py
@@ -588,10 +588,10 @@
     rffi.setintfield(glob_buf, 'c_tm_yday', tm_yday)
     rffi.setintfield(glob_buf, 'c_tm_isdst', space.c_int_w(tup_w[8]))
     #
-    old_tm_zone = glob_buf.c_tm_zone
-    glob_buf.c_tm_zone = lltype.nullptr(rffi.CCHARP.TO)
-    rffi.setintfield(glob_buf, 'c_tm_gmtoff', 0)
     if HAS_TM_ZONE :
+        old_tm_zone = glob_buf.c_tm_zone
+        glob_buf.c_tm_zone = lltype.nullptr(rffi.CCHARP.TO)
+        rffi.setintfield(glob_buf, 'c_tm_gmtoff', 0)
         if len(tup_w) >= 10:
             # NOTE this is not cleanly solved!
             # it saves the string that is later deleted when this
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to