]> granicus.if.org Git - python/commitdiff
Use an assert() for the REQ() macro instead of making up our own
authorGuido van Rossum <guido@python.org>
Mon, 15 Oct 2001 17:23:13 +0000 (17:23 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 15 Oct 2001 17:23:13 +0000 (17:23 +0000)
assertion.

Include/node.h

index df6e5186d35f848deaa766ba1d27223549186270..59f4d72e6ffc7359685d6dac08e2c7ea340adc48 100644 (file)
@@ -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 *);