forked from pool/python314
- Tools/Demos
- gh-128152: Fix a bug where Argument Clinic’s C
pre-processor parser tried to parse pre-processor
directives inside C comments. Patch by Erlend Aasland.
- Tests
- gh-128690: Temporarily do not use test_embed in PGO profile
builds until the problem with test_init_pyvenv_cfg failing
in some configurations is resolved.
- Library
- gh-128731: Fix ResourceWarning in
urllib.robotparser.RobotFileParser.read().
- gh-71339: Add new assertion methods for unittest:
assertHasAttr(), assertNotHasAttr(), assertIsSubclass(),
assertNotIsSubclass() assertStartsWith(),
assertNotStartsWith(), assertEndsWith() and
assertNotEndsWith().
- gh-118761: Improve import time of pickle by 25% by removing
an unnecessary regular expression. As such, re is no more
implicitly available as pickle.re. Patch by Bénédikt Tran.
- gh-128661: Fixes typing.evaluate_forward_ref() not showing
deprecation when type_params arg is not passed.
- gh-128562: Fix possible conflicts in generated tkinter
widget names if the widget class name ends with a digit.
- gh-128559: Improved import time of asyncio.
- gh-128552: Fix cyclic garbage introduced
by asyncio.loop.create_task() and
asyncio.TaskGroup.create_task() holding a reference to the
created task if it is eager.
- gh-128340: Add internal thread safe handle to be used
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python314?expand=0&rev=32
35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
---
|
|
Lib/test/test_ctypes/test_generated_structs.py | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
--- a/Lib/test/test_ctypes/test_generated_structs.py
|
|
+++ b/Lib/test/test_ctypes/test_generated_structs.py
|
|
@@ -12,6 +12,7 @@ Run this module to regenerate the files:
|
|
import unittest
|
|
from test.support import import_helper
|
|
import re
|
|
+import sys
|
|
from dataclasses import dataclass
|
|
from functools import cached_property
|
|
|
|
@@ -21,6 +22,11 @@ from ctypes import sizeof, alignment, po
|
|
_ctypes_test = import_helper.import_module("_ctypes_test")
|
|
|
|
|
|
+def is_32bit():
|
|
+ # or alternatively (slightly slower)
|
|
+ # (struct.calcsize("P") * 8) == 32
|
|
+ return not (sys.maxsize > 2**32)
|
|
+
|
|
# ctypes erases the difference between `c_int` and e.g.`c_int16`.
|
|
# To keep it, we'll use custom subclasses with the C name stashed in `_c_name`:
|
|
class c_bool(ctypes.c_bool):
|
|
@@ -415,6 +421,7 @@ class AnonBitfields(Structure):
|
|
|
|
|
|
class GeneratedTest(unittest.TestCase):
|
|
+ @unittest.skipIf(is_32bit(), 'fails on 32bit platform (gh#python/cpython#121938)')
|
|
def test_generated_data(self):
|
|
"""Check that a ctypes struct/union matches its C equivalent.
|
|
|