@@ -3111,18 +3111,22 @@ class Py_off_t_return_converter(long_return_converter):
3111
3111
type = 'Py_off_t'
3112
3112
conversion_fn = 'PyLong_FromPy_off_t'
3113
3113
3114
- class path_confname_converter (CConverter):
3114
+ class confname_converter (CConverter):
3115
3115
type="int"
3116
- converter="conv_path_confname "
3116
+ converter="conv_confname "
3117
3117
3118
- class confstr_confname_converter(path_confname_converter ):
3119
- converter='conv_confstr_confname'
3118
+ def converter_init(self, *, table ):
3119
+ self.table = table
3120
3120
3121
- class sysconf_confname_converter(path_confname_converter):
3122
- converter="conv_sysconf_confname"
3121
+ def parse_arg(self, argname, displayname, *, limited_capi):
3122
+ return self.format_code("""
3123
+ if (!{converter}(module, {argname}, &{paramname}, "{table}")) {{{{
3124
+ goto exit;
3125
+ }}}}
3126
+ """, argname=argname, converter=self.converter, table=self.table)
3123
3127
3124
3128
[python start generated code]*/
3125
- /*[python end generated code: output=da39a3ee5e6b4b0d input=1860d32584c2a539 ]*/
3129
+ /*[python end generated code: output=da39a3ee5e6b4b0d input=8189d5ae78244626 ]*/
3126
3130
3127
3131
/*[clinic input]
3128
3132
@@ -13660,7 +13664,7 @@ static struct constdef posix_constants_pathconf[] = {
13660
13664
os.fpathconf -> long
13661
13665
13662
13666
fd: fildes
13663
- name: path_confname
13667
+ name: confname(table="pathconf_names")
13664
13668
/
13665
13669
13666
13670
Return the configuration limit name for the file descriptor fd.
@@ -13670,7 +13674,7 @@ If there is no limit, return -1.
13670
13674
13671
13675
static long
13672
13676
os_fpathconf_impl (PyObject * module , int fd , int name )
13673
- /*[clinic end generated code: output=d5b7042425fc3e21 input=5b8d2471cfaae186 ]*/
13677
+ /*[clinic end generated code: output=d5b7042425fc3e21 input=023d44589c9ed6aa ]*/
13674
13678
{
13675
13679
long limit ;
13676
13680
@@ -13688,7 +13692,7 @@ os_fpathconf_impl(PyObject *module, int fd, int name)
13688
13692
/*[clinic input]
13689
13693
os.pathconf -> long
13690
13694
path: path_t(allow_fd='PATH_HAVE_FPATHCONF')
13691
- name: path_confname
13695
+ name: confname(table="pathconf_names")
13692
13696
13693
13697
Return the configuration limit name for the file or directory path.
13694
13698
@@ -13699,7 +13703,7 @@ On some platforms, path may also be specified as an open file descriptor.
13699
13703
13700
13704
static long
13701
13705
os_pathconf_impl (PyObject * module , path_t * path , int name )
13702
- /*[clinic end generated code: output=5bedee35b293a089 input=bc3e2a985af27e5e ]*/
13706
+ /*[clinic end generated code: output=5bedee35b293a089 input=6f6072f57b10c787 ]*/
13703
13707
{
13704
13708
long limit ;
13705
13709
@@ -13880,15 +13884,15 @@ static struct constdef posix_constants_confstr[] = {
13880
13884
/*[clinic input]
13881
13885
os.confstr
13882
13886
13883
- name: confstr_confname
13887
+ name: confname(table="confstr_names")
13884
13888
/
13885
13889
13886
13890
Return a string-valued system configuration variable.
13887
13891
[clinic start generated code]*/
13888
13892
13889
13893
static PyObject *
13890
13894
os_confstr_impl (PyObject * module , int name )
13891
- /*[clinic end generated code: output=bfb0b1b1e49b9383 input=18fb4d0567242e65 ]*/
13895
+ /*[clinic end generated code: output=bfb0b1b1e49b9383 input=4c6ffca2837ec959 ]*/
13892
13896
{
13893
13897
PyObject * result = NULL ;
13894
13898
char buffer [255 ];
@@ -14428,15 +14432,15 @@ static struct constdef posix_constants_sysconf[] = {
14428
14432
14429
14433
/*[clinic input]
14430
14434
os.sysconf -> long
14431
- name: sysconf_confname
14435
+ name: confname(table="sysconf_names")
14432
14436
/
14433
14437
14434
14438
Return an integer-valued system configuration variable.
14435
14439
[clinic start generated code]*/
14436
14440
14437
14441
static long
14438
14442
os_sysconf_impl (PyObject * module , int name )
14439
- /*[clinic end generated code: output=3662f945fc0cc756 input=279e3430a33f29e4 ]*/
14443
+ /*[clinic end generated code: output=3662f945fc0cc756 input=930b8f23b5d15086 ]*/
14440
14444
{
14441
14445
long value ;
14442
14446
0 commit comments