8000 check type with argument clinic · python/cpython@15c8f0d · GitHub
[go: up one dir, main page]

Skip to content

Commit 15c8f0d

Browse files
committed
check type with argument clinic
1 parent fff561e commit 15c8f0d

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

Modules/clinic/posixmodule.c.h

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

Modules/posixmodule.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5501,22 +5501,16 @@ os__path_normpath_impl(PyObject *module, PyObject *path)
55015501
/*[clinic input]
55025502
os._path_abspath
55035503
5504-
path: object
5504+
path: unicode
55055505
/
55065506
55075507
Make path absolute.
55085508
[clinic start generated code]*/
55095509

55105510
static PyObject *
5511-
os__path_abspath(PyObject *module, PyObject *path)
5512-
/*[clinic end generated code: output=6a6bb40f1ebe86f2 input=6f97dcc93c4bd71f]*/
5511+
os__path_abspath_impl(PyObject *module, PyObject *path)
5512+
/*[clinic end generated code: output=b58956d662b60be0 input=577ecb3473d22113]*/
55135513
{
5514-
if (!PyUnicode_Check(path)) {
5515-
PyErr_Format(PyExc_TypeError, "expected 'str', not %T",
5516-
Py_TYPE(path));
5517-
return NULL;
5518-
}
5519-
55205514
Py_ssize_t rel_path_len;
55215515
wchar_t *rel_path = PyUnicode_AsWideCharString(path, &rel_path_len);
55225516
if (!rel_path) {

0 commit comments

Comments
 (0)
0