diff options
author | Gregory P. Smith <greg@krypto.org> | 2015-02-04 01:04:31 -0800 |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2015-02-04 01:04:31 -0800 |
commit | ef3e7a803f7e575ce26cb2e4e29e46da2d89c124 (patch) | |
tree | ec9df5664c8029412e3923f694c3bbbbc9434ee6 /Python/ast.c | |
parent | f97d8cc43c09116bebd4d54b7ef5baf472058de3 (diff) | |
parent | 7c584647e0c2fe3f84299cab3b7941d1595de32f (diff) | |
download | cpython-ef3e7a803f7e575ce26cb2e4e29e46da2d89c124.tar.gz |
Skip some tests that require a subinterpreter launched with -E or -I when the
interpreter under test is being run in an environment that requires the use of
environment variables such as PYTHONHOME in order to function at all.
Adds a test.script_helper.interpreter_requires_environment() function
to be used with @unittest.skipIf on stdlib test methods requiring this.
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c index d50cb80f24..2f1ae60b6c 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -825,6 +825,8 @@ get_operator(const node *n) return Sub; case STAR: return Mult; + case AT: + return MatMult; case SLASH: return Div; case DOUBLESLASH: @@ -1030,6 +1032,8 @@ ast_for_augassign(struct compiling *c, const node *n) return Pow; else return Mult; + case '@': + return MatMult; default: PyErr_Format(PyExc_SystemError, "invalid augassign: %s", STR(n)); return (operator_ty)0; @@ -2257,7 +2261,7 @@ ast_for_expr(struct compiling *c, const node *n) and_expr: shift_expr ('&' shift_expr)* shift_expr: arith_expr (('<<'|'>>') arith_expr)* arith_expr: term (('+'|'-') term)* - term: factor (('*'|'/'|'%'|'//') factor)* + term: factor (('*'|'@'|'/'|'%'|'//') factor)* factor: ('+'|'-'|'~') factor | power power: atom trailer* ('**' factor)* */ @@ -2568,7 +2572,7 @@ ast_for_expr_stmt(struct compiling *c, const node *n) /* expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | ('=' (yield_expr|testlist))*) testlist_star_expr: (test|star_expr) (',' test|star_expr)* [','] - augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' + augassign: '+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' | '//=' test: ... here starts the operator precendence dance */ |