Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bfe51ea

Browse files
committed
Fix assertions.
1 parent c2e2074 commit bfe51ea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Python/compile.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,11 @@ PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
257257
if (!__doc__) {
258258
__doc__ = PyString_InternFromString("__doc__");
259259
if (!__doc__)
260-
goto error;
260+
return NULL;
261261
}
262262

263263
if (!compiler_init(&c))
264-
goto error;
264+
return NULL;
265265
c.c_filename = filename;
266266
c.c_arena = arena;
267267
c.c_future = PyFuture_FromAST(mod, filename);
@@ -291,7 +291,7 @@ PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
291291

292292
error:
293293
compiler_free(&c);
294-
assert(!PyErr_Occurred());
294+
assert(co || PyErr_Occurred());
295295
return co;
296296
}
297297

0 commit comments

Comments
 (0)