8000 gh-85283: Convert grp extension to the limited C API (#116611) · adorilson/cpython@b6ae284 · GitHub
[go: up one dir, main page]

Skip to content

Commit b6ae284

Browse files
vstinneradorilson
authored andcommitted
pythongh-85283: Convert grp extension to the limited C API (python#116611)
posixmodule.h: remove check on the limited C API, since these helpers are not part of the public C API.
1 parent e8dd85d commit b6ae284

File tree

8 files changed

+20
-88
lines changed
  • Modules
  • Tools/c-analyzer/cpython
  • 8 files changed

    +20
    -88
    lines changed

    Include/internal/pycore_global_objects_fini_generated.h

    Lines changed: 0 additions & 1 deletion
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    Include/internal/pycore_global_strings.h

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -472,7 +472,6 @@ struct _Py_global_strings {
    472472
    STRUCT_FOR_ID(hi)
    473473
    STRUCT_FOR_ID(hook)
    474474
    STRUCT_FOR_ID(hour)
    475-
    STRUCT_FOR_ID(id)
    476475
    STRUCT_FOR_ID(ident)
    477476
    STRUCT_FOR_ID(identity_hint)
    478477
    STRUCT_FOR_ID(ignore)

    Include/internal/pycore_runtime_init_generated.h

    Lines changed: 0 additions & 1 deletion
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    Include/internal/pycore_unicodeobject_generated.h

    Lines changed: 0 additions & 3 deletions
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    Modules/clinic/grpmodule.c.h

    Lines changed: 11 additions & 75 deletions
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    Modules/grpmodule.c

    Lines changed: 7 additions & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,15 +1,17 @@
    1-
    21
    /* UNIX group file access module */
    32

    4-
    // clinic/grpmodule.c.h uses internal pycore_modsupport.h API
    5-
    #ifndef Py_BUILD_CORE_BUILTIN
    6-
    # define Py_BUILD_CORE_MODULE 1
    3+
    // Need limited C API version 3.13 for PyMem_RawRealloc()
    4+
    #include "pyconfig.h" // Py_GIL_DISABLED
    5+
    #ifndef Py_GIL_DISABLED
    6+
    #define Py_LIMITED_API 0x030d0000
    77
    #endif
    88

    99
    #include "Python.h"
    1010
    #include "posixmodule.h"
    1111

    12+
    #include <errno.h> // ERANGE
    1213
    #include <grp.h> // getgrgid_r()
    14+
    #include <string.h> // memcpy()
    1315
    #include <unistd.h> // sysconf()
    1416

    1517
    #include "clinic/grpmodule.c.h"
    @@ -88,7 +90,7 @@ mkgrent(PyObject *module, struct group *p)
    8890
    Py_DECREF(x);
    8991
    }
    9092

    91-
    #define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)
    93+
    #define SET(i,val) PyStructSequence_SetItem(v, i, val)
    9294
    SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name));
    9395
    if (p->gr_passwd)
    9496
    SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd));

    Modules/posixmodule.h

    Lines changed: 0 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -2,7 +2,6 @@
    22

    33
    #ifndef Py_POSIXMODULE_H
    44
    #define Py_POSIXMODULE_H
    5-
    #ifndef Py_LIMITED_API
    65
    #ifdef __cplusplus
    76
    extern "C" {
    87
    #endif
    @@ -34,5 +33,4 @@ extern int _Py_Sigset_Converter(PyObject *, void *);
    3433
    #ifdef __cplusplus
    3534
    }
    3635
    #endif
    37-
    #endif // !Py_LIMITED_API
    3836
    #endif // !Py_POSIXMODULE_H

    Tools/c-analyzer/cpython/ignored.tsv

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -740,3 +740,5 @@ Modules/expat/xmlrole.c - error -
    740740
    Modules/_io/_iomodule.c - _PyIO_Module -
    741741
    Modules/_sqlite/module.c - _sqlite3module -
    742742
    Modules/clinic/md5module.c.h _md5_md5 _keywords -
    743+
    Modules/clinic/grpmodule.c.h grp_getgrgid _keywords -
    744+
    Modules/clinic/grpmodule.c.h grp_getgrnam _keywords -

    0 commit comments

    Comments
     (0)
    0