|
14 | 14 | import internal.eval |
15 | 15 |
|
16 | 16 |
|
17 | | -ATOM = [ \ |
18 | | - ('literal_underscore', '_'), |
19 | | - ('literal_true_expr', '1 == 1'), |
20 | | - ('literal_false_expr', '1 != 1'), |
21 | | - ('literal_int', '1'), |
22 | | - ('literal_float', '0.5'), |
23 | | - ('literal_string', '\"foobar\"'), |
24 | | - ('literal_true', 'True'), |
25 | | - ('literal_false', 'False'), |
26 | | - ('literal_none', 'None'), |
27 | | - ('import_stmt', 'import math'), |
28 | | - ('assignment_stmt', 'x = 0'), |
29 | | - ('python_expr', '1+1'), |
30 | | - ('pythonect_expr', '$[1->1]') |
31 | | - ] |
32 | | - |
33 | | - |
34 | | -OPERATOR = [ \ |
35 | | - (None, None), |
36 | | - ('comma', ','), |
37 | | - ('async', '->'), |
38 | | - ('sync', '|') |
39 | | - ] |
| 17 | +ATOM = [ |
| 18 | + ('literal_underscore', '_'), |
| 19 | + ('literal_true_expr', '1 == 1'), |
| 20 | + ('literal_false_expr', '1 != 1'), |
| 21 | + ('literal_int', '1'), |
| 22 | + ('literal_float', '0.5'), |
| 23 | + ('literal_string', '\"foobar\"'), |
| 24 | + ('literal_true', 'True'), |
| 25 | + ('literal_false', 'False'), |
| 26 | + ('literal_none', 'None'), |
| 27 | + ('import_stmt', 'import math'), |
| 28 | + ('assignment_stmt', 'x = 0'), |
| 29 | + ('python_expr', '1+1'), |
| 30 | + ('pythonect_expr', '$[1->1]') |
| 31 | +] |
| 32 | + |
| 33 | + |
| 34 | +OPERATOR = [ |
| 35 | + (None, None), |
| 36 | + ('comma', ','), |
| 37 | + ('async', '->'), |
| 38 | + ('sync', '|') |
| 39 | +] |
40 | 40 |
|
41 | 41 |
|
42 | 42 | # ATOM OPERATOR ATOM OPERATOR ATOM |
@@ -103,9 +103,9 @@ def main(): |
103 | 103 | try: |
104 | 104 |
|
105 | 105 | print '\tdef test_%s(self):\n\n\t\tself.assertEqual( internal.eval.eval(\'%s\', {}, {}) , %s )\n' % \ |
106 | | - ('_'.join(name), ' '.join(expr), __type_wrapper(internal.eval.eval(' '.join(expr), {}, {}))) |
| 106 | + ('_'.join(name), ' '.join(expr), __type_wrapper(internal.eval.eval(' '.join(expr), {}, {}))) |
107 | 107 |
|
108 | | - except Exception, e: |
| 108 | + except Exception as e: |
109 | 109 |
|
110 | 110 | print "%s raises Exception %s" % (' '.join(expr), str(e)) |
111 | 111 |
|
|
0 commit comments