From: Guido van Rossum Date: Mon, 15 Oct 2001 17:23:13 +0000 (+0000) Subject: Use an assert() for the REQ() macro instead of making up our own X-Git-Tag: v2.2.1c1~1280 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5aace07fe00d36fc0bf639ef38c3fc7cdc87eeea;p=python Use an assert() for the REQ() macro instead of making up our own assertion. --- diff --git a/Include/node.h b/Include/node.h index df6e5186d3..59f4d72e6f 100644 --- a/Include/node.h +++ b/Include/node.h @@ -27,16 +27,7 @@ extern DL_IMPORT(void) PyNode_Free(node *n); #define STR(n) ((n)->n_str) /* Assert that the type of a node is what we expect */ -#ifndef Py_DEBUG -#define REQ(n, type) { /*pass*/ ; } -#else -#define REQ(n, type) \ - { if (TYPE(n) != (type)) { \ - fprintf(stderr, "FATAL: node type %d, required %d\n", \ - TYPE(n), type); \ - abort(); \ - } } -#endif +#define REQ(n, type) assert(TYPE(n) == (type)) extern DL_IMPORT(void) PyNode_ListTree(node *);