[Python-checkins] bpo-22273: Disabled tests while investigating buildbot failures on ARM7L/PPC64. (GH-16377)

Vinay Sajip webhook-mailer at python.org
Wed Sep 25 02:58:36 EDT 2019


https://github.com/python/cpython/commit/57dc7d5ae8ebfb6da1ea2b25e61260ecb9c79faf
commit: 57dc7d5ae8ebfb6da1ea2b25e61260ecb9c79faf
branch: master
author: Vinay Sajip <vinay_sajip at yahoo.co.uk>
committer: GitHub <noreply at github.com>
date: 2019-09-25T07:58:32+01:00
summary:

bpo-22273: Disabled tests while investigating buildbot failures on ARM7L/PPC64. (GH-16377)

files:
M Lib/ctypes/test/test_structures.py
M Modules/_ctypes/stgdict.c

diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py
index 11c194b0b73e..67d98c9899c3 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/ctypes/test/test_structures.py
@@ -1,3 +1,4 @@
+import platform
 import unittest
 from ctypes import *
 from ctypes.test import need_symbol
@@ -5,6 +6,8 @@
 import _ctypes_test
 from test import support
 
+MACHINE = platform.machine()
+
 class SubclassesTest(unittest.TestCase):
     def test_subclass(self):
         class X(Structure):
@@ -477,6 +480,8 @@ class X(Structure):
         self.assertEqual(s.first, got.first)
         self.assertEqual(s.second, got.second)
 
+    @unittest.skipIf(MACHINE in ('armv7l', 'ppc64'),
+                     'Test temporarily disabled on this architecture')
     def test_array_in_struct(self):
         # See bpo-22273
 
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index 62dceceb4f4e..9c42a4f68e51 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -652,7 +652,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
 
 #define MAX_ELEMENTS 16
 
-    if (arrays_seen && (size <= 16)) {
+    if (arrays_seen && (size <= MAX_ELEMENTS)) {
         /*
          * See bpo-22273. Arrays are normally treated as pointers, which is
          * fine when an array name is being passed as parameter, but not when



More information about the Python-checkins mailing list