diff --git a/test/bytecode_2.6_run/01_triple_compare.pyc b/test/bytecode_2.6_run/01_triple_compare.pyc index 62768f9b..210dce5b 100644 Binary files a/test/bytecode_2.6_run/01_triple_compare.pyc and b/test/bytecode_2.6_run/01_triple_compare.pyc differ diff --git a/test/bytecode_3.2_run/01_triple_compare.pyc b/test/bytecode_3.2_run/01_triple_compare.pyc index 22372e38..73afe5b8 100644 Binary files a/test/bytecode_3.2_run/01_triple_compare.pyc and b/test/bytecode_3.2_run/01_triple_compare.pyc differ diff --git a/test/bytecode_3.3_run/01_triple_compare.pyc b/test/bytecode_3.3_run/01_triple_compare.pyc index 3e85ec9f..de2a8862 100644 Binary files a/test/bytecode_3.3_run/01_triple_compare.pyc and b/test/bytecode_3.3_run/01_triple_compare.pyc differ diff --git a/test/bytecode_3.6_run/01_triple_compare.pyc b/test/bytecode_3.6_run/01_triple_compare.pyc index 45516434..7886a917 100644 Binary files a/test/bytecode_3.6_run/01_triple_compare.pyc and b/test/bytecode_3.6_run/01_triple_compare.pyc differ diff --git a/test/bytecode_3.7_run/01_triple_compare.pyc b/test/bytecode_3.7_run/01_triple_compare.pyc new file mode 100644 index 00000000..68d14dd7 Binary files /dev/null and b/test/bytecode_3.7_run/01_triple_compare.pyc differ diff --git a/test/bytecode_3.8_run/01_triple_compare.pyc b/test/bytecode_3.8_run/01_triple_compare.pyc new file mode 100644 index 00000000..d9e14e9d Binary files /dev/null and b/test/bytecode_3.8_run/01_triple_compare.pyc differ diff --git a/test/simple_source/bug33/01_triple_compare.py b/test/simple_source/bug33/01_triple_compare.py index 6878e042..dc28d36c 100644 --- a/test/simple_source/bug33/01_triple_compare.py +++ b/test/simple_source/bug33/01_triple_compare.py @@ -14,3 +14,23 @@ def _is_valid_netmask(netmask): # See in 2.6.9 quopri.py ishex(): assert not '0' <= __file__ <= '9' or 'a' <= __file__ <= 'f' or 'A' <= __file__ <= 'F' + +# From 3.7 bug-grammar.py + +# Bug in 3.7 was handling the last line where compare_chained -> compare_chained37 and +# therefore compare_chained has one child, not two as it normally does. + +def test_comparison(): + ### comparison: expr (comp_op expr)* + ### comp_op: '<'|'>'|'=='|'>='|'<='|'!='|'in'|'not' 'in'|'is'|'is' 'not' + if 1: pass + x = (1 == 1) + if 1 == 1: pass + if 1 != 1: pass + if 1 < 1: pass + if 1 > 1: pass + if 1 <= 1: pass + if 1 >= 1: pass + if 1 in (): pass + if 1 not in (): pass + if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass diff --git a/uncompyle6/semantics/customize37.py b/uncompyle6/semantics/customize37.py index 4a420ad9..09f96d8f 100644 --- a/uncompyle6/semantics/customize37.py +++ b/uncompyle6/semantics/customize37.py @@ -276,6 +276,13 @@ def customize_for_version37(self, version): self.n_call = n_call + def n_compare_chained(node): + if node[0] == "compare_chained37": + self.default(node[0]) + else: + self.default(node) + self.n_compare_chained = n_compare_chained + def n_importlist37(node): if len(node) == 1: self.default(node)