Merge branch 'master' into python-2.4

This commit is contained in:
rocky
2017-12-03 12:29:05 -05:00
3 changed files with 74 additions and 52 deletions

View File

@@ -11,52 +11,73 @@ typeset -i STOP_ONERROR=1
typeset -A SKIP_TESTS
case $PYVERSION in
2.4)
SKIP_TESTS=( [test_binop.py]=1 # need to fix tryelse
[test_cgi.py]=1 # need to fix tryelse
[test_codecs.py]=1 # need to fix tryelse
[test_decorators.py]=1 # Syntax error decorators?
[test_dis.py]=1 # We change line numbers - duh!
[test_extcall.py]=1 # TypeError: saboteur() takes no arguments (1 given)
[test_format.py]=1 # Control flow?
[test_grp.py]=1 # Long test - might work Control flow?
[test_import.py]=1 # Control flow?
[test_long_future.py]=1 # Control flow?
[test_math.py]=1 # Control flow?
[test_pwd.py]=1 # Long test - might work? Control flow?
[test_queue.py]=1 # Control flow?
[test_sax.py]=1 # Control flow?
# [test_threading.py]=1 # Long test - works
[test_types.py]=1 # Control flow?
)
SKIP_TESTS=(
[test_binop.py]=1 # need to fix tryelse
[test_cgi.py]=1 # need to fix tryelse
[test_codecs.py]=1 # need to fix tryelse
[test_decorators.py]=1 # Syntax error decorators?
[test_dis.py]=1 # We change line numbers - duh!
[test_extcall.py]=1 # TypeError: saboteur() takes no arguments (1 given)
[test_format.py]=1 # Control flow?
[test_grp.py]=1 # Long test - might work Control flow?
[test_import.py]=1 # Control flow?
[test_long_future.py]=1 # Control flow?
[test_math.py]=1 # Control flow?
[test_pwd.py]=1 # Long test - might work? Control flow?
[test_queue.py]=1 # Control flow?
[test_sax.py]=1 # Control flow?
# [test_threading.py]=1 # Long test - works
[test_types.py]=1 # Control flow?
)
;;
2.5)
SKIP_TESTS=(
[test_cgi.py]=1 # need to fix tryelse
[test_codecs.py]=1 # need to fix tryelse
[test_decorators.py]=1 # Syntax error decorators?
[test_dis.py]=1 # We change line numbers - duh!
[test_extcall.py]=1 # TypeError: saboteur() takes no arguments (1 given)
[test_format.py]=1 # Control flow?
[test_grp.py]=1 # Long test - might work Control flow?
[test_long_future.py]=1 # Control flow?
[test_math.py]=1 # Control flow?
[test_pwd.py]=1 # Long test - might work? Control flow?
[test_queue.py]=1 # Control flow?
[test_sax.py]=1 # Control flow?
[test_types.py]=1 # Control flow?
[test_cgi.py]=1 # need to fix tryelse
[test_codecs.py]=1 # need to fix tryelse
[test_decorators.py]=1 # Syntax error decorators?
[test_dis.py]=1 # We change line numbers - duh!
[test_extcall.py]=1 # TypeError: saboteur() takes no arguments (1 given)
[test_format.py]=1 # Control flow?
[test_grp.py]=1 # Long test - might work Control flow?
[test_long_future.py]=1 # Control flow?
[test_math.py]=1 # Control flow?
[test_pwd.py]=1 # Long test - might work? Control flow?
[test_queue.py]=1 # Control flow?
[test_sax.py]=1 # Control flow?
[test_types.py]=1 # Control flow?
)
;;
2.6)
SKIP_TESTS=( [test_array.py]=1 [test_asyncore.py]=1)
SKIP_TESTS=(
[test_binop.py]=1 # need to fix tryelse
[test_cmath.py]=1 # Control flow?
[test_codecs.py]=1 # need to fix tryelse
[test_coercion.py]=1 # Control flow?
[test_cookielib.py]=1 # Control flow?
[test_contextlib.py]=1 # decorators
[test_decorators.py]=1 # decorators
[test_enumerate.py]=1 # Control flow?
[test_file.py]=1 # Control flow?
[test_format.py]=1 # Control flow?
[test_frozen.py]=1 # Control flow?
[test_ftplib.py]=1 # Control flow?
[test_funcattrs.py]=1 # Control flow?
[test_future4.py]=1 # Possible additional rule for future mechanism?
[test_grammar.py]=1 # Syntax error -- look at
[test_grp.py]=1 # Long test - might work Control flow?
[test_pwd.py]=1 # Long test - might work? Control flow?
[test_queue.py]=1 # Control flow?
)
;;
2.7)
SKIP_TESTS=(
[test_builtin.py]=1
[test_contextlib.py]=1 # decorators
[test_decorators.py]=1 # decorators
[test_decimal.py]=1
[test_descr.py]=1 # syntax error look at
[test_dis.py]=1 # We change line numbers - duh!
[test_future4.py]=1 # Possible additional rule for future mechanism?
[test_grammar.py]=1 # Long test look at
[test_importlib.py]=1 # Control flow?
)
;;
*)

View File

@@ -112,12 +112,12 @@ TABLE_DIRECT = {
(0, 'expr' ), ),
'get_iter': ( 'iter(%c)',
(0, 'expr'), ),
'slice0': ( '%c[:]',
'slice0': ( '%c[:]',
(0, 'expr'), ),
'slice1': ( '%c[%p:]',
'slice1': ( '%c[%p:]',
(0, 'expr'),
(1, 100) ),
'slice2': ( '%c[:%p]',
'slice2': ( '%c[:%p]',
(0, 'expr'),
(1, 100) ),
'slice3': ( '%c[%p:%p]',
@@ -126,16 +126,16 @@ TABLE_DIRECT = {
'IMPORT_FROM': ( '%{pattr}', ),
'load_attr': ( '%c.%[1]{pattr}',
(0, 'expr')),
(0, 'expr')),
'LOAD_FAST': ( '%{pattr}', ),
'LOAD_NAME': ( '%{pattr}', ),
'LOAD_CLASSNAME': ( '%{pattr}', ),
'LOAD_GLOBAL': ( '%{pattr}', ),
'LOAD_DEREF': ( '%{pattr}', ),
'LOAD_LOCALS': ( 'locals()', ),
'LOAD_GLOBAL': ( '%{pattr}', ),
'LOAD_DEREF': ( '%{pattr}', ),
'LOAD_LOCALS': ( 'locals()', ),
'LOAD_ASSERT': ( '%{pattr}', ),
'DELETE_FAST': ( '%|del %{pattr}\n', ),
'DELETE_NAME': ( '%|del %{pattr}\n', ),
'DELETE_FAST': ( '%|del %{pattr}\n', ),
'DELETE_NAME': ( '%|del %{pattr}\n', ),
'DELETE_GLOBAL': ( '%|del %{pattr}\n', ),
'delete_subscr': ( '%|del %c[%c]\n', 0, 1,),
'subscript': ( '%c[%p]',
@@ -144,23 +144,23 @@ TABLE_DIRECT = {
'subscript2': ( '%c[%c]',
(0, 'expr'),
(1, 'expr') ),
'store_subscr': ( '%c[%c]', 0, 1),
'STORE_FAST': ( '%{pattr}', ),
'STORE_NAME': ( '%{pattr}', ),
'STORE_GLOBAL': ( '%{pattr}', ),
'STORE_DEREF': ( '%{pattr}', ),
'unpack': ( '%C%,', (1, maxint, ', ') ),
'store_subscr': ( '%c[%c]', 0, 1),
'STORE_FAST': ( '%{pattr}', ),
'STORE_NAME': ( '%{pattr}', ),
'STORE_GLOBAL': ( '%{pattr}', ),
'STORE_DEREF': ( '%{pattr}', ),
'unpack': ( '%C%,', (1, maxint, ', ') ),
# This nonterminal we create on the fly in semantic routines
'unpack_w_parens': ( '(%C%,)', (1, maxint, ', ') ),
# This nonterminal we create on the fly in semantic routines
'load_attr': ( '(%c).%[1]{pattr}',
'load_attr_w_parens': ( '(%c).%[1]{pattr}',
(0, 'expr')),
'unpack_list': ( '[%C]',
'unpack_list': ( '[%C]',
(1, maxint, ', ') ),
'build_tuple2': ( '%P',
'build_tuple2': ( '%P',
(0, -1, ', ', 100) ),
'list_iter': ( '%c', 0 ),

View File

@@ -1879,7 +1879,8 @@ class SourceWalker(GenericASTTraversal, object):
n_unpack_w_parens = n_unpack
def n_load_attr(self, node):
if node[0] == 'LOAD_CONST':
if (node[0] == 'LOAD_CONST' or
node[0] == 'expr' and node[0][0] == 'LOAD_CONST'):
node.kind = 'load_attr_w_parens'
self.default(node)