diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-03-30 20:03:44 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-03-30 20:03:44 +0000 |
commit | 618dc5e06459dab5fae2dc0a8caee7d15afd6410 (patch) | |
tree | 2881b2c079821ef43895742f3c65171acf582cc1 /Python/compile.c | |
parent | d3372793d6de665be2f866e9245a33bcefeaaa76 (diff) | |
download | cpython-git-618dc5e06459dab5fae2dc0a8caee7d15afd6410.tar.gz |
Merged revisions 62004 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r62004 | georg.brandl | 2008-03-28 13:11:56 +0100 (Fr, 28 Mär 2008) | 4 lines
Patch #1810 by Thomas Lee, reviewed by myself:
allow compiling Python AST objects into code objects
in compile().
........
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Python/compile.c b/Python/compile.c index 7d5ada62f5..ab51c7bb26 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2356,8 +2356,11 @@ unaryop(unaryop_ty op) return UNARY_POSITIVE; case USub: return UNARY_NEGATIVE; + default: + PyErr_Format(PyExc_SystemError, + "unary op %d should not be possible", op); + return 0; } - return 0; } static int @@ -2388,8 +2391,11 @@ binop(struct compiler *c, operator_ty op) return BINARY_AND; case FloorDiv: return BINARY_FLOOR_DIVIDE; + default: + PyErr_Format(PyExc_SystemError, + "binary op %d should not be possible", op); + return 0; } - return 0; } static int @@ -2416,8 +2422,9 @@ cmpop(cmpop_ty op) return PyCmp_IN; case NotIn: return PyCmp_NOT_IN; + default: + return PyCmp_BAD; } - return PyCmp_BAD; } static int @@ -2448,10 +2455,11 @@ inplace_binop(struct compiler *c, operator_ty op) return INPLACE_AND; case FloorDiv: return INPLACE_FLOOR_DIVIDE; + default: + PyErr_Format(PyExc_SystemError, + "inplace binary op %d should not be possible", op); + return 0; } - PyErr_Format(PyExc_SystemError, - "inplace binary op %d should not be possible", op); - return 0; } static int |