GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-99284: [ctypes] remove `_use_broken_old_ctypes_structure_semantics_` by sobolevn · Pull Request #99285 · python/cpython

gh-99284: [ctypes] remove _use_broken_old_ctypes_structure_semantics_ #99285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
gpshead merged 4 commits into python:main from sobolevn:issue-99284
Nov 19, 2022

Uh oh!

There was an error while loading. Please reload this page.

Merged

gh-99284: [ctypes] remove _use_broken_old_ctypes_structure_semantics_ #99285

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
63d1574
gh-99284: [ctypes] remove `_use_broken_old_ctypes_structure_semantics_`
sobolevn Nov 9, 2022
1388dd0
Address review
sobolevn Nov 18, 2022
decbe2c
Merge branch 'main' into issue-99284
sobolevn Nov 18, 2022
7962b11
Update globals-to-fix.tsv
sobolevn Nov 18, 2022
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

4 changes: 4 additions & 0 deletions 4 Doc/whatsnew/3.12.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -873,3 +873,7 @@ Removed
* Remove the ``PyUnicode_InternImmortal()`` function and the
``SSTATE_INTERNED_IMMORTAL`` macro.
(Contributed by Victor Stinner in :gh:`85858`.)

* Remove ``_use_broken_old_ctypes_structure_semantics_`` flag
from :mod:`ctypes` module.
(Contributed by Nikita Sobolev in :gh:`99285`.)
1 change: 0 additions & 1 deletion 1 Include/internal/pycore_global_objects_fini_generated.h
Show comments
View file
Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

1 change: 0 additions & 1 deletion 1 Include/internal/pycore_global_strings.h
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(_swappedbytes_)
STRUCT_FOR_ID(_type_)
STRUCT_FOR_ID(_uninitialized_submodules)
STRUCT_FOR_ID(_use_broken_old_ctypes_structure_semantics_)
STRUCT_FOR_ID(_warn_unawaited_coroutine)
STRUCT_FOR_ID(_xoptions)
STRUCT_FOR_ID(a)
Expand Down
1 change: 0 additions & 1 deletion 1 Include/internal/pycore_runtime_init_generated.h
Show comments
View file
Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

2 changes: 0 additions & 2 deletions 2 Include/internal/pycore_unicodeobject_generated.h
Show comments
View file
Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

2 changes: 2 additions & 0 deletions 2 Misc/NEWS.d/next/Library/2022-11-09-12-36-12.gh-issue-99284.9p4J2l.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove ``_use_broken_old_ctypes_structure_semantics_``
old untested and undocumented hack from :mod:`ctypes`.
23 changes: 1 addition & 22 deletions 23 Modules/_ctypes/stgdict.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,6 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
int big_endian;
int arrays_seen = 0;

/* HACK Alert: I cannot be bothered to fix ctypes.com, so there has to
be a way to use the old, broken semantics: _fields_ are not extended
but replaced in subclasses.

XXX Remove this in ctypes 1.0!
*/
int use_broken_old_ctypes_semantics;

if (fields == NULL)
return 0;

Expand All @@ -378,19 +370,6 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
big_endian = PY_BIG_ENDIAN;
}

if (_PyObject_LookupAttr(type,
&_Py_ID(_use_broken_old_ctypes_structure_semantics_), &tmp) < 0)
{
return -1;
}
if (tmp) {
Py_DECREF(tmp);
use_broken_old_ctypes_semantics = 1;
}
else {
use_broken_old_ctypes_semantics = 0;
}

if (_PyObject_LookupAttr(type, &_Py_ID(_pack_), &tmp) < 0) {
return -1;
}
Expand Down Expand Up @@ -454,7 +433,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
if (!isStruct) {
stgdict->flags |= TYPEFLAG_HASUNION;
}
if (basedict && !use_broken_old_ctypes_semantics) {
if (basedict) {
size = offset = basedict->size;
align = basedict->align;
union_size = 0;
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.