]> granicus.if.org Git - python/commitdiff
Fix assertions.
authorThomas Wouters <thomas@python.org>
Mon, 27 Feb 2006 22:48:55 +0000 (22:48 +0000)
committerThomas Wouters <thomas@python.org>
Mon, 27 Feb 2006 22:48:55 +0000 (22:48 +0000)
Python/compile.c

index c09aa701bf209f41cfecac8603faaf3f0c91333a..d5555d57d9cd7e7b3b38b6417daaac40dc168e7a 100644 (file)
@@ -257,11 +257,11 @@ PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
         if (!__doc__) {
             __doc__ = PyString_InternFromString("__doc__");
             if (!__doc__)
-                goto error;
+                return NULL;
         }
 
        if (!compiler_init(&c))
-               goto error;
+               return NULL;
        c.c_filename = filename;
         c.c_arena = arena;
        c.c_future = PyFuture_FromAST(mod, filename);
@@ -291,7 +291,7 @@ PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
 
  error:
        compiler_free(&c);
-       assert(!PyErr_Occurred());
+       assert(co || PyErr_Occurred());
        return co;
 }