summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-10-23 12:12:25 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-10-23 12:12:25 (GMT)
commitf8d7d41507d8c0855b58c9be14011381d03c5cde (patch)
tree1a38be5e64aaf4c64a7581f209548818926cdb0f /Modules
parent8c9331057d0f5c75cd3e73f3f85fe237da0f9ed1 (diff)
downloadcpython-f8d7d41507d8c0855b58c9be14011381d03c5cde.zip
cpython-f8d7d41507d8c0855b58c9be14011381d03c5cde.tar.gz
cpython-f8d7d41507d8c0855b58c9be14011381d03c5cde.tar.bz2
Issue #28511: Use the "U" format instead of "O!" in PyArg_Parse*.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_datetimemodule.c5
-rw-r--r--Modules/clinic/unicodedata.c.h6
-rw-r--r--Modules/unicodedata.c7
3 files changed, 7 insertions, 11 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 5ddf650..cced71c 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -3243,9 +3243,8 @@ timezone_new(PyTypeObject *type, PyObject *args, PyObject *kw)
{
PyObject *offset;
PyObject *name = NULL;
- if (PyArg_ParseTupleAndKeywords(args, kw, "O!|O!:timezone", timezone_kws,
- &PyDateTime_DeltaType, &offset,
- &PyUnicode_Type, &name))
+ if (PyArg_ParseTupleAndKeywords(args, kw, "O!|U:timezone", timezone_kws,
+ &PyDateTime_DeltaType, &offset, &name))
return new_timezone(offset, name);
return NULL;
diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h
index d481ccb..e8a73b9 100644
--- a/Modules/clinic/unicodedata.c.h
+++ b/Modules/clinic/unicodedata.c.h
@@ -306,8 +306,8 @@ unicodedata_UCD_normalize(PyObject *self, PyObject *args)
const char *form;
PyObject *input;
- if (!PyArg_ParseTuple(args, "sO!:normalize",
- &form, &PyUnicode_Type, &input)) {
+ if (!PyArg_ParseTuple(args, "sU:normalize",
+ &form, &input)) {
goto exit;
}
return_value = unicodedata_UCD_normalize_impl(self, form, input);
@@ -379,4 +379,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=5313ce129da87b2f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=07e93c267323a576 input=a9049054013a1b77]*/
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 9e71e01..fbe811e 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -808,7 +808,7 @@ unicodedata.UCD.normalize
self: self
form: str
- unistr as input: object(subclass_of='&PyUnicode_Type')
+ unistr as input: unicode
/
Return the normal form 'form' for the Unicode string unistr.
@@ -819,11 +819,8 @@ Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.
static PyObject *
unicodedata_UCD_normalize_impl(PyObject *self, const char *form,
PyObject *input)
-/*[clinic end generated code: output=62d1f8870027efdc input=cd092e631cf11883]*/
+/*[clinic end generated code: output=62d1f8870027efdc input=1744c55f4ab79bf0]*/
{
- if (PyUnicode_READY(input) == -1)
- return NULL;
-
if (PyUnicode_GET_LENGTH(input) == 0) {
/* Special case empty input strings, since resizing
them later would cause internal errors. */