Skip to content

Commit

Permalink
Fix 3.4+ keyword-only parameter handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Jan 5, 2020
1 parent d088e7e commit bbfdb81
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
46 changes: 44 additions & 2 deletions test/stdlib/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ case $PYVERSION in

[test_capi.py]=1
[test_curses.py]=1 # Possibly fails on its own but not detected
[test test_cmd_line.py]=1 # Takes too long, maybe hangs, or looking for interactive input?
[test_cmd_line.py]=1 # Takes too long, maybe hangs, or looking for interactive input?
[test_compilex.py]=1 # Probably complex literals again. Investigate
[test_dis.py]=1 # We change line numbers - duh!
[test_doctest.py]=1 # Fails on its own
[test_exceptions.py]=1
Expand Down Expand Up @@ -148,9 +149,46 @@ case $PYVERSION in
SKIP_TESTS[test_base64.py]=1
fi
;;
3.0)
SKIP_TESTS=(
[test_array.py]=1 # Handling of bytestring
[test_concurrent_futures.py]=1 # too long to run over 46 seconds by itself
[test_datetimetester.py]=1
[test_decimal.py]=1
[test_dis.py]=1 # We change line numbers - duh!
[test_fileio.py]=1
)
if (( batch )) ; then
# Fails in crontab environment?
# Figure out what's up here
SKIP_TESTS[test_exception_variations.py]=1
SKIP_TESTS[test_quopri.py]=1
fi
;;
3.1)
SKIP_TESTS=(
[test_collections.py]=1
[test_concurrent_futures.py]=1 # too long to run over 46 seconds by itself
[test_datetimetester.py]=1
[test_decimal.py]=1
[test_dis.py]=1 # We change line numbers - duh!
[test_fileio.py]=1
)
if (( batch )) ; then
# Fails in crontab environment?
# Figure out what's up here
SKIP_TESTS[test_exception_variations.py]=1
SKIP_TESTS[test_quopri.py]=1
fi
;;
3.2)
SKIP_TESTS=(
[test_ast.py]=1 # Look at: AssertionError: b'hi' != 'hi'
[test_cmd_line.py]=1
[test_collections.py]=1
[test_concurrent_futures.py]=1 # too long to run over 46 seconds by itself
[test_datetimetester.py]=1
[test_decimal.py]=1
[test_dis.py]=1 # We change line numbers - duh!
[test_quopri.py]=1 # TypeError: Can't convert 'bytes' object to str implicitly
)
Expand All @@ -176,7 +214,11 @@ case $PYVERSION in

3.4)
SKIP_TESTS=(
[test_asynchat.py]=1 #
[test_asyncore.py]=1 #
[test_atexit.py]=1 #
[test_bdb.py]=1 #
[test_binascii]=1
[test_dis.py]=1 # We change line numbers - duh!
)
if (( batch )) ; then
Expand All @@ -188,7 +230,7 @@ case $PYVERSION in
;;
3.5)
SKIP_TESTS=(
[test_ast.py]=1 #
[test_ast.py]=1 # line 379, in test_literal_eval self.assertEqual(ast.literal_eval('b"hi"'), 'hi')
[test_atexit.py]=1 #
[test_builtin.py]=1 #
[test_compare.py]=1
Expand Down
4 changes: 2 additions & 2 deletions test/test_pyenvlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ def visitor(files, dirname, names):
pass

if len(files) > max_files:
files = [file for file in files if not "site-packages" in file]
files = [file for file in files if not "test" in file]
files = [file for file in files if not "site-packages" in file and (file.endswith(".pyo") or file.endswith(".pyc"))]
files = [file for file in files if not "test" in file and (file.endswith(".pyo") or file.endswith(".pyc"))]
if len(files) > max_files:
# print("Number of files %d - truncating to last 200" % len(files))
print(
Expand Down
2 changes: 1 addition & 1 deletion uncompyle6/semantics/make_function3.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def build_param(ast, name, default, annotation=None):
ends_in_comma = True

kw_args = [None] * kwonlyargcount
kw_nodes = node[0]
kw_nodes = node[args_node.attr[0]]
if kw_nodes == "kwargs":
for n in kw_nodes:
name = eval(n[0].pattr)
Expand Down

0 comments on commit bbfdb81

Please sign in to comment.