summaryrefslogtreecommitdiffstats
path: root/Tools/clinic
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-10-13 09:39:41 (GMT)
committerLarry Hastings <larry@hastings.org>2014-10-13 09:39:41 (GMT)
commitdfbeb160de829d16d3668dec5bc902a31ad25835 (patch)
treec5389a8396acbab2ec6ac82350405d786aaa3444 /Tools/clinic
parent6f3bdc94848d8c99ad2b7eb79e90ddb6e9f602c6 (diff)
downloadcpython-dfbeb160de829d16d3668dec5bc902a31ad25835.zip
cpython-dfbeb160de829d16d3668dec5bc902a31ad25835.tar.gz
cpython-dfbeb160de829d16d3668dec5bc902a31ad25835.tar.bz2
Issue #22615: Argument Clinic now supports the "type" argument for the
int converter. This permits using the int converter with enums and typedefs.
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-xTools/clinic/clinic.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 962abdf..92edf6f 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -2426,11 +2426,13 @@ class int_converter(CConverter):
format_unit = 'i'
c_ignored_default = "0"
- def converter_init(self, *, types='int'):
+ def converter_init(self, *, types='int', type=None):
if types == 'str':
self.format_unit = 'C'
elif types != 'int':
fail("int_converter: illegal 'types' argument")
+ if type != None:
+ self.type = type
class unsigned_int_converter(CConverter):
type = 'unsigned int'