diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-21 01:49:52 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-21 01:49:52 (GMT) |
commit | 9e30aa52fd416e17b692c4f22e57191cdd6ec654 (patch) | |
tree | f3b1c85f5cdbb6a32ec8f309400e8d3e1c2bbfaf /Python/_warnings.c | |
parent | f3ae6208c706bae89d86df44c7c3dcac1bdcd94d (diff) | |
download | cpython-9e30aa52fd416e17b692c4f22e57191cdd6ec654.zip cpython-9e30aa52fd416e17b692c4f22e57191cdd6ec654.tar.gz cpython-9e30aa52fd416e17b692c4f22e57191cdd6ec654.tar.bz2 |
Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()
And PyUnicode_GetSize() => PyUnicode_GetLength()
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r-- | Python/_warnings.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c index 2e5b0dd..a494dd9 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -203,13 +203,13 @@ normalize_module(PyObject *filename) mod_str = _PyUnicode_AsString(filename); if (mod_str == NULL) - return NULL; - len = PyUnicode_GetSize(filename); + return NULL; + len = PyUnicode_GetLength(filename); if (len < 0) return NULL; if (len >= 3 && strncmp(mod_str + (len - 3), ".py", 3) == 0) { - module = PyUnicode_FromStringAndSize(mod_str, len-3); + module = PyUnicode_Substring(filename, 0, len-3); } else { module = filename; @@ -506,7 +506,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, if (PyUnicode_READY(*filename)) goto handle_error; - len = PyUnicode_GetSize(*filename); + len = PyUnicode_GetLength(*filename); kind = PyUnicode_KIND(*filename); data = PyUnicode_DATA(*filename); @@ -690,7 +690,7 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds) } /* Split the source into lines. */ - source_list = PyObject_CallMethodObjArgs(source, + source_list = PyObject_CallMethodObjArgs(source, PyId_splitlines.object, NULL); Py_DECREF(source); |