This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jianxu3
Recipients jianxu3
Date 2019-01-15.09:32:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547544727.75.0.967204925198.issue35741@roundup.psfhosted.org>
In-reply-to
Content
Whether or not the HAVE_STRUCT_TM_TM_ZONE is defined, _STRUCT_TM_ITEMS always equal to 11. It is initialized at PyInit_time(void).
PyModule_AddIntConstant(m, "_STRUCT_TM_ITEMS", 11);

If I modify it like this:
#ifdef HAVE_STRUCT_TM_TM_ZONE
PyModule_AddIntConstant(m, "_STRUCT_TM_ITEMS", 11)
#else
PyModule_AddIntConstant(m, "_STRUCT_TM_ITEMS", 9)
#endif

Then test_fields at test_structseq.py will fail.

def test_fields(self):
self.assertEqual(t.n_fields, time._STRUCT_TM_ITEMS)

What I hope is that if HAVE_STRUCT_TM_TM_ZONE is not defined, test_localtime_timezone will be skipped.
History
Date User Action Args
2019-01-15 09:32:09jianxu3setrecipients: + jianxu3
2019-01-15 09:32:07jianxu3setmessageid: <1547544727.75.0.967204925198.issue35741@roundup.psfhosted.org>
2019-01-15 09:32:07jianxu3linkissue35741 messages
2019-01-15 09:32:07jianxu3create