commit | 790465fd90e8a72590386465f518db9e67ab843f | [log] [tgz] |
---|---|---|
author | Martin v. Löwis <martin@v.loewis.de> | Sat Apr 05 20:41:37 2008 +0000 |
committer | Martin v. Löwis <martin@v.loewis.de> | Sat Apr 05 20:41:37 2008 +0000 |
tree | 62e3e47f6f97120dfdfc94a87dc1a06414d95a13 | |
parent | b9279bc88f867d9d3b6606502a678b137329b54d [diff] [blame] |
Change command line processing API to use wchar_t. Fixes #2128.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 60cbffa..29ca08c 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c
@@ -553,10 +553,16 @@ PyUnicodeObject *unicode; if (w == NULL) { + if (size == 0) + return PyUnicode_FromStringAndSize(NULL, 0); PyErr_BadInternalCall(); return NULL; } + if (size == -1) { + size = wcslen(w); + } + unicode = _PyUnicode_New(size); if (!unicode) return NULL;