mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-10-07 10:13:39 +00:00
Correct handling "if" in dictcomp in semantic actions for 3.x
This commit is contained in:
parent
3c2dafe74c
commit
5cdf057a47
Binary file not shown.
Binary file not shown.
@ -3,12 +3,24 @@
|
||||
#
|
||||
# This code is RUNNABLE!
|
||||
def x(s):
|
||||
return {k: v
|
||||
for (k, v) in s
|
||||
if not k.startswith('_')
|
||||
}
|
||||
return {k: v for (k, v) in s if not k.startswith("_")}
|
||||
|
||||
|
||||
# Yes, the print() is funny. This is
|
||||
# to test though a 2-arg assert where
|
||||
# the 2nd argument is not a string.
|
||||
assert x((('_foo', None),)) == {}, print("See issue #162")
|
||||
assert x((("_foo", None),)) == {}, print("See issue #162")
|
||||
|
||||
# From 3.7 test_dictcomps.py
|
||||
assert {k: v for k in range(10) for v in range(10) if k == v} == {
|
||||
0: 0,
|
||||
1: 1,
|
||||
2: 2,
|
||||
3: 3,
|
||||
4: 4,
|
||||
5: 5,
|
||||
6: 6,
|
||||
7: 7,
|
||||
8: 8,
|
||||
9: 9,
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ SKIP_TESTS=(
|
||||
[test_concurrent_futures.py]=1 # too long?
|
||||
[test_decimal.py]=1 # test takes too long to run: 18 seconds
|
||||
[test_descr.py]=1 # test assertion errors
|
||||
[test_dictcomps.py]=1 # test assertion errors
|
||||
[test_doctest.py]=1 # test assertion errors
|
||||
[test_doctest2.py]=1 # test assertion errors
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
|
@ -21,7 +21,6 @@ SKIP_TESTS=(
|
||||
[test_decimal.py]=1 # test takes too long to run: 18 seconds
|
||||
[test_devpoll.py]=1 # it fails on its own
|
||||
[test_descr.py]=1 # Doesn't terminate
|
||||
[test_dictcomps.py]=1 # test assertion failure
|
||||
[test_dict.py]=1 #
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
[test_distutils.py]=1 # it fails on its own
|
||||
|
@ -32,7 +32,6 @@ SKIP_TESTS=(
|
||||
|
||||
[test_devpoll.py]=1 # it fails on its own
|
||||
[test_dict.py]=1 #
|
||||
[test_dictcomps.py]=1 # test assertion failure
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
[test_distutils.py]=1 # it fails on its own
|
||||
[test_dbm_gnu.py]=1 # Doesn't terminate
|
||||
|
@ -51,7 +51,6 @@ SKIP_TESTS=(
|
||||
[test_descr.py]=1 # syntax error: Investigate
|
||||
[test_devpoll.py]=1 # it fails on its own
|
||||
[test_dict.py]=1 # it fails on its own
|
||||
[test_dictcomps.py]=1 # We change line numbers - duh!
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
[test_doctest2.py]=1 #
|
||||
[test_doctest.py]=1 #
|
||||
|
@ -31,7 +31,6 @@ SKIP_TESTS=(
|
||||
[test_decimal.py]=1 # Parse error
|
||||
[test_descr.py]=1 # Parse error
|
||||
[test_devpoll.py]=1 # it fails on its own
|
||||
[test_dictcomps.py]=1 # Bad semantics - Investigate
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
[test_doctest2.py]=1 # assert failure
|
||||
[test_docxmlrpc.py]=1
|
||||
|
@ -274,7 +274,7 @@ fi
|
||||
PYENV_ROOT=${PYENV_ROOT:-$HOME/.pyenv}
|
||||
pyenv_local=$(pyenv local)
|
||||
|
||||
# pyenv version cleaning
|
||||
# pyenv version update
|
||||
for dir in ../ ../../ ; do
|
||||
cp -v .python-version $dir
|
||||
done
|
||||
|
@ -1333,7 +1333,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
|
||||
if comp_store:
|
||||
self.preorder(comp_for)
|
||||
elif if_node:
|
||||
if if_node:
|
||||
self.write(" if ")
|
||||
if have_not:
|
||||
self.write("not ")
|
||||
|
Loading…
Reference in New Issue
Block a user