Kaydet (Commit) 2863c10a authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Use Py_FatalError instead of abort.

üst 2f7f8c4a
...@@ -326,7 +326,8 @@ fp_readl(char *s, int size, struct tok_state *tok) ...@@ -326,7 +326,8 @@ fp_readl(char *s, int size, struct tok_state *tok)
{ {
#ifndef Py_USING_UNICODE #ifndef Py_USING_UNICODE
/* In a non-Unicode built, this should never be called. */ /* 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 #else
PyObject* utf8; PyObject* utf8;
PyObject* buf = tok->decoding_buffer; PyObject* buf = tok->decoding_buffer;
...@@ -403,7 +404,7 @@ static void fp_ungetc(int c, struct tok_state *tok) { ...@@ -403,7 +404,7 @@ static void fp_ungetc(int c, struct tok_state *tok) {
static char * static char *
decoding_fgets(char *s, int size, struct tok_state *tok) decoding_fgets(char *s, int size, struct tok_state *tok)
{ {
char *line; char *line = NULL;
int warn = 0, badchar = 0; int warn = 0, badchar = 0;
for (;;) { for (;;) {
if (tok->decoding_state < 0) { if (tok->decoding_state < 0) {
......
...@@ -1186,7 +1186,8 @@ static PyObject * ...@@ -1186,7 +1186,8 @@ static PyObject *
decode_utf8(char **sPtr, char *end, char* encoding) decode_utf8(char **sPtr, char *end, char* encoding)
{ {
#ifndef Py_USING_UNICODE #ifndef Py_USING_UNICODE
abort(); Py_FatalError("decode_utf8 should not be called in this build.");
return NULL;
#else #else
PyObject *u, *v; PyObject *u, *v;
char *s, *t; char *s, *t;
...@@ -1319,7 +1320,7 @@ parsestr(struct compiling *com, char *s) ...@@ -1319,7 +1320,7 @@ parsestr(struct compiling *com, char *s)
#ifndef Py_USING_UNICODE #ifndef Py_USING_UNICODE
/* This should not happen - we never see any other /* This should not happen - we never see any other
encoding. */ encoding. */
abort(); Py_FatalError("cannot deal with encodings in this build.");
#else #else
PyObject* u = PyUnicode_DecodeUTF8(s, len, NULL); PyObject* u = PyUnicode_DecodeUTF8(s, len, NULL);
if (u == NULL) if (u == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment