py: Protect mp_parse and mp_compile with nlr push/pop block.

To enable parsing constants more efficiently, mp_parse should be allowed
to raise an exception, and mp_compile can already raise a MemoryError.
So these functions need to be protected by an nlr push/pop block.

This patch adds that feature in all places.  This allows to simplify how
mp_parse and mp_compile are called: they now raise an exception if they
have an error and so explicit checking is not needed anymore.
This commit is contained in:
Damien George
2015-02-07 18:33:58 +00:00
parent e1e359ff59
commit 0bfc7638ba
17 changed files with 97 additions and 365 deletions

View File

@@ -28,7 +28,6 @@
#include <string.h>
#include "py/nlr.h"
#include "py/parsehelper.h"
#include "py/compile.h"
#include "py/runtime0.h"
#include "py/runtime.h"