Use Py_FatalError instead of abort.
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 7 Aug 2002 15:18:57 +0000 (15:18 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 7 Aug 2002 15:18:57 +0000 (15:18 +0000)
Parser/tokenizer.c
Python/compile.c

index 34fbfa66fe2741c619f386b50f09b99a86b5141b..64ff320d65fb11de779293753b69e1f8a35ee693 100644 (file)
@@ -326,7 +326,8 @@ fp_readl(char *s, int size, struct tok_state *tok)
 {
 #ifndef Py_USING_UNICODE
        /* In a non-Unicode built, this should never be called. */
-       abort();
+       Py_FatalError("fp_readl should not be called in this build.");
+       return NULL;
 #else
        PyObject* utf8;
        PyObject* buf = tok->decoding_buffer;
@@ -403,7 +404,7 @@ static void fp_ungetc(int c, struct tok_state *tok) {
 static char *
 decoding_fgets(char *s, int size, struct tok_state *tok)
 {
-       char *line;
+       char *line = NULL;
        int warn = 0, badchar = 0;
        for (;;) {
                if (tok->decoding_state < 0) {
index b67193773c7893af74bd9fdcb8565b9b68535e03..79756eab0ec0881285c8c737ddf1fdfc95344f92 100644 (file)
@@ -1186,7 +1186,8 @@ static PyObject *
 decode_utf8(char **sPtr, char *end, char* encoding)
 {
 #ifndef Py_USING_UNICODE
-       abort();
+       Py_FatalError("decode_utf8 should not be called in this build.");
+        return NULL;
 #else
        PyObject *u, *v;
        char *s, *t;
@@ -1319,7 +1320,7 @@ parsestr(struct compiling *com, char *s)
 #ifndef Py_USING_UNICODE
                        /* This should not happen - we never see any other
                           encoding. */
-                       abort();
+                       Py_FatalError("cannot deal with encodings in this build.");
 #else
                        PyObject* u = PyUnicode_DecodeUTF8(s, len, NULL);
                        if (u == NULL)