Hello community,

here is the log from the commit of package python-uncompyle6 for 
openSUSE:Factory checked in at 2020-07-26 16:18:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-uncompyle6 (Old)
 and      /work/SRC/openSUSE:Factory/.python-uncompyle6.new.3592 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-uncompyle6"

Sun Jul 26 16:18:30 2020 rev:9 rq:822409 version:3.7.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-uncompyle6/python-uncompyle6.changes      
2020-06-14 18:24:12.112397790 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-uncompyle6.new.3592/python-uncompyle6.changes
    2020-07-26 16:19:34.536821284 +0200
@@ -1,0 +2,11 @@
+Thu Jul 23 11:45:46 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- update to 3.7.2
+  * Use newer xdis
+  * Docstrings (again) which were broken again on earlier Python
+  * Fix 2.6 and 2.7 decompilation bug in handling "list if" comprehensions
+  * Handle 3.7+ "else" branch removal adAs seen in `_cmp()` of 
`python3.8/distutils/version.py` with optimization `-O2`
+  * 3.6+ "with" and "with .. as" grammar improvements
+  * ast-check for "for" loop was missing some grammar rules
+
+-------------------------------------------------------------------

Old:
----
  uncompyle6-3.7.0.tar.gz

New:
----
  uncompyle6-3.7.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-uncompyle6.spec ++++++
--- /var/tmp/diff_new_pack.6NZrjD/_old  2020-07-26 16:19:37.356823921 +0200
+++ /var/tmp/diff_new_pack.6NZrjD/_new  2020-07-26 16:19:37.356823921 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-uncompyle6
-Version:        3.7.0
+Version:        3.7.2
 Release:        0
 Summary:        Python cross-version byte-code decompiler
 License:        GPL-3.0-only

++++++ uncompyle6-3.7.0.tar.gz -> uncompyle6-3.7.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/ChangeLog 
new/uncompyle6-3.7.2/ChangeLog
--- old/uncompyle6-3.7.0/ChangeLog      2020-05-19 06:54:51.000000000 +0200
+++ new/uncompyle6-3.7.2/ChangeLog      2020-06-28 05:05:48.000000000 +0200
@@ -1,3 +1,146 @@
+2020-06-27  rocky <[email protected]>
+
+       * uncompyle6/version.py: Get ready for release 3.7.2
+
+2020-06-27  rocky <[email protected]>
+
+       * uncompyle6/parsers/reducecheck/or_check.py: Back off "or" check
+       using instructions vs opcodes
+
+2020-06-27  rocky <[email protected]>
+
+       * uncompyle6/parsers/reducecheck/or_check.py: Back off buggy "or"
+       check
+
+2020-06-27  rocky <[email protected]>
+
+       * test/stdlib/2.5-exclude.sh, test/stdlib/2.6-exclude.sh: Last
+       commit fixed test_pep352.py
+
+2020-06-27  rocky <[email protected]>
+
+       * uncompyle6/parsers/parse26.py, uncompyle6/parsers/parse27.py,
+       uncompyle6/parsers/reducecheck/or_check.py: Add "comp_if_not" for
+       2.6-
+
+2020-06-27  rocky <[email protected]>
+
+       * uncompyle6/parsers/reducecheck/ifelsestmt.py: Handle more ifelse
+       reduction rules patterns
+
+2020-06-26  rocky <[email protected]>
+
+       * uncompyle6/semantics/pysource.py,
+       uncompyle6/semantics/transform.py: Workaround bug detecting
+       MAKE_FUNCTION docstrings
+
+2020-06-21  rocky <[email protected]>
+
+       * __pkginfo__.py, uncompyle6/main.py: Adjust for newer xdis
+
+2020-06-17  rocky <[email protected]>
+
+       * : commit 2a8daca25d25d5be039cab88f5f8e931d115cbe1 Author: rocky
+       <[email protected]> Date:   Wed Jun 17 10:12:56 2020 -0400
+
+2020-06-17  rocky <[email protected]>
+
+       * test/stdlib/3.7-exclude.sh: Add another 3.7 stdlib exclusion test
+
+2020-06-17  rocky <[email protected]>
+
+       * test/run-and-email.sh: Disable compile-farm 3.8.3 checking
+
+2020-06-15  rocky <[email protected]>
+
+       * admin-tools/how-to-make-a-release.md,
+       uncompyle6/parsers/parse38.py, uncompyle6/semantics/customize38.py: 
+       Towards fixing a 3.8 try except-as bug
+
+2020-06-12  rocky <[email protected]>
+
+       * admin-tools/how-to-make-a-release.md: Administrivia
+
+2020-06-12  rocky <[email protected]>
+
+       * uncompyle6/parsers/reducecheck/ifelsestmt.py: New grammar rule
+       often imples expanded reduce rule
+
+2020-06-12  rocky <[email protected]>
+
+       * .circleci/config.yml, .travis.yml, NEWS.md, uncompyle6/version.py: 
+       Get ready for release 3.7.1
+
+2020-06-12  rocky <[email protected]>
+
+       * test/add-test.py, test/simple_source/bug37/03_else_removal.py,
+       uncompyle6/parsers/parse37.py: Handle 3.7+ "else" branch removal...  As 
seen in _cmp() of python3.8/distutils/version.py with
+       optimization -O2
+
+2020-06-10  rocky <[email protected]>
+
+       * .circleci/config.yml: CI take 3.
+
+2020-06-10  rocky <[email protected]>
+
+       * .travis.yml: CI update take 2
+
+2020-06-10  rocky <[email protected]>
+
+       * .circleci/config.yml, .travis.yml, __pkginfo__.py: Update CI to
+       use git xdis
+
+2020-06-04  rocky <[email protected]>
+
+       * uncompyle6/parsers/parse3.py, uncompyle6/parsers/parse36.py: Push
+       "with" grammar improvements back to 3.6
+
+2020-06-04  rocky <[email protected]>
+
+       * test/simple_source/stmts/04_withas.py,
+       uncompyle6/semantics/check_ast.py: ast-check "for" is a loop; sync
+       "withas" test ..  with decompyle3.
+
+2020-06-04  rocky <[email protected]>
+
+       * test/simple_source/bug35/04_call_function.py,
+       test/simple_source/stmts/04_withas.py,
+       uncompyle6/parsers/parse37base.py,
+       uncompyle6/semantics/check_ast.py: Fix bug in 3.8 with .. as
+
+2020-05-31  rocky <[email protected]>
+
+       * __pkginfo__.py: Bump min xdis version...  it fixes a bug in stdlib 
testing
+
+2020-05-31  rocky <[email protected]>
+
+       * test/stdlib/3.2-exclude.sh, test/stdlib/3.4-exclude.sh,
+       test/stdlib/3.5-exclude.sh, test/stdlib/3.6-exclude.sh,
+       test/stdlib/runtests.sh: With a newer xdis, some stdlib test work
+       now
+
+2020-05-24  rocky <[email protected]>
+
+       * test/stdlib/3.7-exclude.sh: More excludes
+
+2020-05-19  rocky <[email protected]>
+
+       * test/stdlib/3.3-exclude.sh, test/stdlib/3.4-exclude.sh,
+       test/stdlib/3.7-exclude.sh: A regression regarding "and"/"or" with
+       "continue"
+
+2020-05-19  rocky <[email protected]>
+
+       * README.rst: Some typos
+
+2020-05-19  rocky <[email protected]>
+
+       * admin-tools/how-to-make-a-release.md: Administrivia
+
+2020-05-19  rocky <[email protected]>
+
+       * NEWS.md: Get ready for release 3.7.0
+
 2020-05-19  rocky <[email protected]>
 
        * test/{simple-uncompyle-code-test.py =>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/PKG-INFO 
new/uncompyle6-3.7.2/PKG-INFO
--- old/uncompyle6-3.7.0/PKG-INFO       2020-05-19 07:37:03.274866300 +0200
+++ new/uncompyle6-3.7.2/PKG-INFO       2020-06-28 05:18:18.989318600 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: uncompyle6
-Version: 3.7.0
+Version: 3.7.2
 Summary: Python cross-version byte-code decompiler
 Home-page: https://github.com/rocky/python-uncompyle6/
 Author: Rocky Bernstein, Hartmut Goebel, John Aycock, and others
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/__pkginfo__.py 
new/uncompyle6-3.7.2/__pkginfo__.py
--- old/uncompyle6-3.7.0/__pkginfo__.py 2020-05-19 05:24:06.000000000 +0200
+++ new/uncompyle6-3.7.2/__pkginfo__.py 2020-06-28 05:13:34.000000000 +0200
@@ -69,7 +69,7 @@
     ]}
 ftp_url            = None
 install_requires   = ["spark-parser >= 1.8.9, < 1.9.0",
-                      "xdis >= 4.6.0, < 4.7.0"]
+                      "xdis >= 4.7.0, <5.1.0"]
 
 license            = "GPL3"
 mailing_list       = "[email protected]"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/test/add-test.py 
new/uncompyle6-3.7.2/test/add-test.py
--- old/uncompyle6-3.7.0/test/add-test.py       2019-10-28 18:18:17.000000000 
+0100
+++ new/uncompyle6-3.7.2/test/add-test.py       2020-06-13 03:17:38.000000000 
+0200
@@ -19,6 +19,7 @@
     else:
         cfile = "bytecode_%s%s/%s" % (version, suffix, short) + "c"
     print("byte-compiling %s to %s" % (path, cfile))
-    py_compile.compile(path, cfile)
+    optimize = 2
+    py_compile.compile(path, cfile, optimize=optimize)
     if isinstance(version, str) or version >= (2, 6, 0):
         os.system("../bin/uncompyle6 -a -T %s" % cfile)
Binary files old/uncompyle6-3.7.0/test/bytecode_2.6/04_withas.pyc and 
new/uncompyle6-3.7.2/test/bytecode_2.6/04_withas.pyc differ
Binary files old/uncompyle6-3.7.0/test/bytecode_2.7/04_withas.pyc and 
new/uncompyle6-3.7.2/test/bytecode_2.7/04_withas.pyc differ
Binary files old/uncompyle6-3.7.0/test/bytecode_3.0/04_withas.pyc and 
new/uncompyle6-3.7.2/test/bytecode_3.0/04_withas.pyc differ
Binary files old/uncompyle6-3.7.0/test/bytecode_3.1/04_withas.pyc and 
new/uncompyle6-3.7.2/test/bytecode_3.1/04_withas.pyc differ
Binary files old/uncompyle6-3.7.0/test/bytecode_3.6/04_withas.pyc and 
new/uncompyle6-3.7.2/test/bytecode_3.6/04_withas.pyc differ
Binary files old/uncompyle6-3.7.0/test/bytecode_3.7/03_else_removal.pyc and 
new/uncompyle6-3.7.2/test/bytecode_3.7/03_else_removal.pyc differ
Binary files old/uncompyle6-3.7.0/test/bytecode_3.7/04_withas.pyc and 
new/uncompyle6-3.7.2/test/bytecode_3.7/04_withas.pyc differ
Binary files old/uncompyle6-3.7.0/test/bytecode_3.8/03_else_removal.pyc and 
new/uncompyle6-3.7.2/test/bytecode_3.8/03_else_removal.pyc differ
Binary files 
old/uncompyle6-3.7.0/test/simple_source/bug33/__pycache__/04_lambda_star_default.cpython-32.pyc
 and 
new/uncompyle6-3.7.2/test/simple_source/bug33/__pycache__/04_lambda_star_default.cpython-32.pyc
 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/uncompyle6-3.7.0/test/simple_source/bug35/04_call_function.py 
new/uncompyle6-3.7.2/test/simple_source/bug35/04_call_function.py
--- old/uncompyle6-3.7.0/test/simple_source/bug35/04_call_function.py   
2020-02-08 21:24:06.000000000 +0100
+++ new/uncompyle6-3.7.2/test/simple_source/bug35/04_call_function.py   
2020-06-13 03:17:38.000000000 +0200
@@ -2,6 +2,7 @@
 # Bug was code not knowing which Python versions
 # have kwargs coming before positional args in code.
 
+"""This program is self-checking!"""
 # RUNNABLE!
 
 def tometadata(self, metadata, schema, Table, args, name=None):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/uncompyle6-3.7.0/test/simple_source/bug37/03_else_removal.py 
new/uncompyle6-3.7.2/test/simple_source/bug37/03_else_removal.py
--- old/uncompyle6-3.7.0/test/simple_source/bug37/03_else_removal.py    
1970-01-01 01:00:00.000000000 +0100
+++ new/uncompyle6-3.7.2/test/simple_source/bug37/03_else_removal.py    
2020-06-13 03:17:38.000000000 +0200
@@ -0,0 +1,12 @@
+# From python3.8/distutils/version.py with optimization -O2
+# The bug was that the other "else" constant propagated removed.
+
+# NOTE: this program needs to be compile with optimization
+def _cmp (b, c):
+    if b:
+        if c:
+            return 0
+        else:
+            return 1
+    else:
+        assert False, "never get here"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/uncompyle6-3.7.0/test/simple_source/stmts/04_withas.py 
new/uncompyle6-3.7.2/test/simple_source/stmts/04_withas.py
--- old/uncompyle6-3.7.0/test/simple_source/stmts/04_withas.py  2017-12-02 
15:31:11.000000000 +0100
+++ new/uncompyle6-3.7.2/test/simple_source/stmts/04_withas.py  2020-06-13 
03:17:38.000000000 +0200
@@ -16,3 +16,25 @@
     with self.assertRaises(ZeroDivisionError):
         with nested(a(), b()) as (x, y):
                 1 // 0
+
+# From 3.7.7 test_functools.py
+# Bug is a unreachable code after "return"
+def test_invalid_registrations(x):
+    return
+    with x:
+        x = 1
+
+# From 3.7.7 test_re.py
+# Bug was hooking in c_with.
+def test_re_tests(tests):
+    for t in tests:
+        with a:
+            continue
+
+# Adapted from 3.8 distutils/command/config.py
+# In 3.8 the problem was in handling "with .. as" code
+def _gen_temp_sourcefile(x, a, headers, lang):
+    with x as y:
+        if a:
+            y = 2
+    return 5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/main.py 
new/uncompyle6-3.7.2/uncompyle6/main.py
--- old/uncompyle6-3.7.0/uncompyle6/main.py     2020-05-19 07:36:47.000000000 
+0200
+++ new/uncompyle6-3.7.2/uncompyle6/main.py     2020-06-28 05:16:06.000000000 
+0200
@@ -119,12 +119,10 @@
                 mapstream = _get_outstream(mapstream)
 
             deparsed = deparse_code_with_map(
-                bytecode_version,
                 co,
                 out,
-                showasm,
-                showast,
-                showgrammar,
+                bytecode_version,
+                debug_opts,
                 code_objects=code_objects,
                 is_pypy=is_pypy,
             )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/parsers/parse26.py 
new/uncompyle6-3.7.2/uncompyle6/parsers/parse26.py
--- old/uncompyle6-3.7.0/uncompyle6/parsers/parse26.py  2020-05-15 
05:19:25.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/parsers/parse26.py  2020-06-28 
05:13:34.000000000 +0200
@@ -232,7 +232,10 @@
 
         comp_for ::= SETUP_LOOP expr for_iter store comp_iter jb_pb_come_from
 
-        comp_body ::= gen_comp_body
+        comp_iter   ::= comp_if_not
+        comp_if_not ::= expr jmp_true comp_iter
+
+        comp_body   ::= gen_comp_body
 
         for_block ::= l_stmts_opt _come_froms POP_TOP JUMP_BACK
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/parsers/parse27.py 
new/uncompyle6-3.7.2/uncompyle6/parsers/parse27.py
--- old/uncompyle6-3.7.0/uncompyle6/parsers/parse27.py  2020-05-19 
07:36:47.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/parsers/parse27.py  2020-06-28 
05:16:06.000000000 +0200
@@ -8,7 +8,6 @@
 from uncompyle6.parsers.parse2 import Python2Parser
 from uncompyle6.parsers.reducecheck import (
     or_check,
-    ifelsestmt,
     tryelsestmt,
 )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/parsers/parse3.py 
new/uncompyle6-3.7.2/uncompyle6/parsers/parse3.py
--- old/uncompyle6-3.7.0/uncompyle6/parsers/parse3.py   2020-05-19 
07:36:47.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/parsers/parse3.py   2020-06-28 
05:16:06.000000000 +0200
@@ -679,6 +679,7 @@
                 "RAISE",
                 "SETUP",
                 "UNPACK",
+                "WITH",
             )
         )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/parsers/parse36.py 
new/uncompyle6-3.7.2/uncompyle6/parsers/parse36.py
--- old/uncompyle6-3.7.0/uncompyle6/parsers/parse36.py  2020-05-19 
07:36:47.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/parsers/parse36.py  2020-06-28 
05:16:06.000000000 +0200
@@ -1,4 +1,4 @@
-#  Copyright (c) 2016-2019 Rocky Bernstein
+#  Copyright (c) 2016-2020 Rocky Bernstein
 #
 #  This program is free software: you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -305,28 +305,25 @@
                 self.addRule(rule, nop_func)
                 # Check to combine assignment + annotation into one statement
                 self.check_reduce['assign'] = 'token'
+            elif opname == "WITH_CLEANUP_START":
+                rules_str = """
+                  stmt        ::= with_null
+                  with_null   ::= with_suffix
+                  with_suffix ::= WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                """
+                self.addRule(rules_str, nop_func)
             elif opname == 'SETUP_WITH':
                 rules_str = """
-                with       ::= expr SETUP_WITH POP_TOP suite_stmts_opt 
COME_FROM_WITH
-                               WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                  with       ::= expr SETUP_WITH POP_TOP suite_stmts_opt 
COME_FROM_WITH
+                                 with_suffix
 
-                # Removes POP_BLOCK LOAD_CONST from 3.6-
-                withasstmt ::= expr SETUP_WITH store suite_stmts_opt 
COME_FROM_WITH
-                               WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                  # Removes POP_BLOCK LOAD_CONST from 3.6-
+                  withasstmt ::= expr SETUP_WITH store suite_stmts_opt 
COME_FROM_WITH
+                                 with_suffix
+                  with       ::= expr SETUP_WITH POP_TOP suite_stmts_opt 
POP_BLOCK
+                                 BEGIN_FINALLY COME_FROM_WITH
+                                 with_suffix
                 """
-                if self.version < 3.8:
-                    rules_str += """
-                    with       ::= expr SETUP_WITH POP_TOP suite_stmts_opt 
POP_BLOCK
-                                   LOAD_CONST
-                                   WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
-                    """
-                else:
-                    rules_str += """
-                    with       ::= expr SETUP_WITH POP_TOP suite_stmts_opt 
POP_BLOCK
-                                   BEGIN_FINALLY COME_FROM_WITH
-                                   WITH_CLEANUP_START WITH_CLEANUP_FINISH
-                                   END_FINALLY
-                    """
                 self.addRule(rules_str, nop_func)
                 pass
             pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/parsers/parse37.py 
new/uncompyle6-3.7.2/uncompyle6/parsers/parse37.py
--- old/uncompyle6-3.7.0/uncompyle6/parsers/parse37.py  2020-05-19 
07:36:47.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/parsers/parse37.py  2020-06-28 
05:16:06.000000000 +0200
@@ -94,6 +94,9 @@
         else_suitec ::= c_stmts
         else_suitec ::= returns
 
+        else_suite_opt ::= else_suite
+        else_suite_opt ::= pass
+
         stmt ::= classdef
         stmt ::= call_stmt
 
@@ -635,6 +638,12 @@
         if_exp37                   ::= expr expr jf_cfs expr COME_FROM
         jf_cfs                     ::= JUMP_FORWARD _come_froms
         ifelsestmt                 ::= testexpr c_stmts_opt jf_cfs else_suite 
opt_come_from_except
+
+        # This is probably more realistically an "ifstmt" (with a null else)
+        # see _cmp() of 
python3.8/distutils/__pycache__/version.cpython-38.opt-1.pyc
+        ifelsestmt                 ::= testexpr stmts jf_cfs else_suite_opt 
opt_come_from_except
+
+
         expr_pjit                  ::= expr POP_JUMP_IF_TRUE
         expr_jit                   ::= expr JUMP_IF_TRUE
         expr_jt                    ::= expr jmp_true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/parsers/parse37base.py 
new/uncompyle6-3.7.2/uncompyle6/parsers/parse37base.py
--- old/uncompyle6-3.7.0/uncompyle6/parsers/parse37base.py      2020-05-18 
10:06:24.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/parsers/parse37base.py      2020-06-13 
03:17:38.000000000 +0200
@@ -127,6 +127,7 @@
                 "RAISE",
                 "SETUP",
                 "UNPACK",
+                "WITH",
             )
         )
 
@@ -993,55 +994,70 @@
                 )
                 custom_ops_processed.add(opname)
 
+            elif opname == "WITH_CLEANUP_START":
+                rules_str = """
+                  stmt        ::= with_null
+                  with_null   ::= with_suffix
+                  with_suffix ::= WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                """
+                self.addRule(rules_str, nop_func)
             elif opname == "SETUP_WITH":
                 rules_str = """
                   stmt       ::= with
                   stmt       ::= withasstmt
 
-                  with       ::= expr SETUP_WITH POP_TOP suite_stmts_opt 
COME_FROM_WITH
-                                 WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                  with       ::= expr
+                                 SETUP_WITH POP_TOP
+                                 suite_stmts_opt
+                                 COME_FROM_WITH
+                                 with_suffix
                   withasstmt ::= expr SETUP_WITH store suite_stmts_opt 
COME_FROM_WITH
-                                 WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                                 with_suffix
 
                   with       ::= expr
-                                 SETUP_WITH POP_TOP suite_stmts_opt
+                                 SETUP_WITH POP_TOP
+                                 suite_stmts_opt
                                  POP_BLOCK LOAD_CONST COME_FROM_WITH
-                                 WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                                 with_suffix
+
                   withasstmt ::= expr
                                  SETUP_WITH store suite_stmts_opt
                                  POP_BLOCK LOAD_CONST COME_FROM_WITH
-                                 WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                                 with_suffix
 
                   with       ::= expr
                                  SETUP_WITH POP_TOP suite_stmts_opt
                                  POP_BLOCK LOAD_CONST COME_FROM_WITH
-                                 WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                                 with_suffix
                   withasstmt ::= expr
                                  SETUP_WITH store suite_stmts_opt
                                  POP_BLOCK LOAD_CONST COME_FROM_WITH
-                                 WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                                 with_suffix
                 """
                 if self.version < 3.8:
                     rules_str += """
                     with     ::= expr SETUP_WITH POP_TOP suite_stmts_opt 
POP_BLOCK
                                    LOAD_CONST
-                                   WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                                   with_suffix
                     """
                 else:
                     rules_str += """
-                      with    ::= expr
+                      with       ::= expr
                                      SETUP_WITH POP_TOP suite_stmts_opt
                                      POP_BLOCK LOAD_CONST COME_FROM_WITH
-                                     WITH_CLEANUP_START WITH_CLEANUP_FINISH 
END_FINALLY
+                                     with_suffix
 
                       withasstmt ::= expr
                                      SETUP_WITH store suite_stmts_opt
                                      POP_BLOCK LOAD_CONST COME_FROM_WITH
 
-                       with    ::= expr SETUP_WITH POP_TOP suite_stmts_opt 
POP_BLOCK
+                      withasstmt ::= expr
+                                     SETUP_WITH store suite_stmts
+                                     POP_BLOCK BEGIN_FINALLY COME_FROM_WITH 
with_suffix
+
+                      with       ::= expr SETUP_WITH POP_TOP suite_stmts_opt 
POP_BLOCK
                                      BEGIN_FINALLY COME_FROM_WITH
-                                     WITH_CLEANUP_START WITH_CLEANUP_FINISH
-                                     END_FINALLY
+                                     with_suffix
                     """
                 self.addRule(rules_str, nop_func)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/parsers/parse38.py 
new/uncompyle6-3.7.2/uncompyle6/parsers/parse38.py
--- old/uncompyle6-3.7.0/uncompyle6/parsers/parse38.py  2020-05-19 
07:36:47.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/parsers/parse38.py  2020-06-28 
05:16:06.000000000 +0200
@@ -45,6 +45,7 @@
         stmt               ::= try_elsestmtl38
         stmt               ::= try_except_ret38
         stmt               ::= try_except38
+        stmt               ::= try_except_as
         stmt               ::= whilestmt38
         stmt               ::= whileTruestmt38
         stmt               ::= call_stmt
@@ -133,6 +134,8 @@
         except_cond1       ::= DUP_TOP expr COMPARE_OP jmp_false
                                POP_TOP POP_TOP POP_TOP
                                POP_EXCEPT
+        except_cond_as     ::= DUP_TOP expr COMPARE_OP POP_JUMP_IF_FALSE
+                               POP_TOP STORE_FAST POP_TOP
 
         try_elsestmtl38    ::= SETUP_FINALLY suite_stmts_opt POP_BLOCK
                                except_handler38 COME_FROM
@@ -145,6 +148,10 @@
         # suite_stmts has a return
         try_except38       ::= SETUP_FINALLY POP_BLOCK suite_stmts
                                except_handler38b
+        try_except_as      ::= SETUP_FINALLY POP_BLOCK suite_stmts
+                               except_handler_as END_FINALLY COME_FROM
+        try_except_as      ::= SETUP_FINALLY suite_stmts
+                               except_handler_as END_FINALLY COME_FROM
 
         try_except_ret38   ::= SETUP_FINALLY returns except_ret38a
         try_except_ret38a  ::= SETUP_FINALLY returns except_handler38c
@@ -165,6 +172,11 @@
         except_handler38a  ::= COME_FROM_FINALLY POP_TOP POP_TOP POP_TOP
                                POP_EXCEPT POP_TOP stmts END_FINALLY
 
+        except_handler38c  ::= COME_FROM_FINALLY except_cond1a except_stmts
+                               POP_EXCEPT JUMP_FORWARD COME_FROM
+        except_handler_as  ::= COME_FROM_FINALLY except_cond_as tryfinallystmt
+                               POP_EXCEPT JUMP_FORWARD COME_FROM
+
         tryfinallystmt     ::= SETUP_FINALLY suite_stmts_opt POP_BLOCK
                                BEGIN_FINALLY COME_FROM_FINALLY suite_stmts_opt
                                END_FINALLY
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/uncompyle6-3.7.0/uncompyle6/parsers/reducecheck/ifelsestmt.py 
new/uncompyle6-3.7.2/uncompyle6/parsers/reducecheck/ifelsestmt.py
--- old/uncompyle6-3.7.0/uncompyle6/parsers/reducecheck/ifelsestmt.py   
2020-05-15 05:48:16.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/parsers/reducecheck/ifelsestmt.py   
2020-06-28 05:13:34.000000000 +0200
@@ -95,6 +95,34 @@
                 "else_suite",
             ),
         ),
+        (
+            "ifelsestmt",
+            (
+                "testexpr",
+                "stmts",
+                "jf_cfs",
+                "else_suite_opt",
+                "opt_come_from_except",
+            ),
+        ),
+        (
+            "ifelsestmt",
+            (
+                "testexpr",
+                "stmts",
+                "jf_cfs",
+                "\\e_else_suite_opt",
+                "\\e_opt_come_from_except")
+        ),
+        (
+            "ifelsestmt",
+            (
+                "testexpr",
+                "stmts",
+                "jf_cfs",
+                "\\e_else_suite_opt",
+                "opt_come_from_except")
+        ),
     ])
 
 def ifelsestmt(self, lhs, n, rule, ast, tokens, first, last):
@@ -103,12 +131,17 @@
         # ifelsestmt jumped outside of loop. No good.
         return True
 
+    # print("XXX", first, last)
+    # for t in range(first, last):
+    #     print(tokens[t])
+    # print("=" * 30)
+
     if rule not in IFELSE_STMT_RULES:
         # print("XXX", rule)
         return False
 
     # Avoid if/else where the "then" is a "raise_stmt1" for an
-    # assert statemetn. Parse this as an "assert" instead.
+    # assert statement. Parse this as an "assert" instead.
     stmts = ast[1]
     if stmts in ("c_stmts",) and len(stmts) == 1:
         raise_stmt1 = stmts[0]
@@ -176,9 +209,7 @@
             if jump_else_end == "jf_cf_pop":
                 jump_else_end = jump_else_end[0]
 
-            jump_to_jump = False
             if jump_else_end == "JUMP_FORWARD":
-                jump_to_jump = True
                 endif_target = int(jump_else_end.pattr)
                 last_offset = tokens[last].off2int()
                 if endif_target != last_offset:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/semantics/check_ast.py 
new/uncompyle6-3.7.2/uncompyle6/semantics/check_ast.py
--- old/uncompyle6-3.7.0/uncompyle6/semantics/check_ast.py      2019-04-14 
05:34:13.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/semantics/check_ast.py      2020-06-13 
03:17:38.000000000 +0200
@@ -8,22 +8,29 @@
 before reduction and don't reduce when there is a problem.
 """
 
+
 def checker(ast, in_loop, errors):
     if ast is None:
         return
-    in_loop = (in_loop or (ast.kind in ('while1stmt', 'whileTruestmt',
-                                      'whilestmt', 'whileelsestmt', 
'while1elsestmt',
-                                      'for_block'))
-               or ast.kind.startswith('async_for'))
-    if ast.kind in ('aug_assign1', 'aug_assign2') and ast[0][0] == 'and':
+    in_loop = (
+        in_loop
+        or ast.kind.startswith("for")
+        or ast.kind.startswith("while")
+        or ast.kind.startswith("async_for")
+    )
+    if ast.kind in ("aug_assign1", "aug_assign2") and ast[0][0] == "and":
         text = str(ast)
-        error_text = '\n# improper augmented assigment (e.g. +=, *=, 
...):\n#\t' + '\n# '.join(text.split("\n")) + '\n'
+        error_text = (
+            "\n# improper augmented assigment (e.g. +=, *=, ...):\n#\t"
+            + "\n# ".join(text.split("\n"))
+            + "\n"
+        )
         errors.append(error_text)
 
     for node in ast:
-        if not in_loop and node.kind in ('continue', 'break'):
+        if not in_loop and node.kind in ("continue", "break"):
             text = str(node)
-            error_text = '\n# not in loop:\n#\t' + '\n# 
'.join(text.split("\n"))
+            error_text = "\n# not in loop:\n#\t" + "\n# 
".join(text.split("\n"))
             errors.append(error_text)
-        if hasattr(node, '__repr1__'):
+        if hasattr(node, "__repr1__"):
             checker(node, in_loop, errors)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/semantics/customize38.py 
new/uncompyle6-3.7.2/uncompyle6/semantics/customize38.py
--- old/uncompyle6-3.7.0/uncompyle6/semantics/customize38.py    2020-05-19 
05:24:06.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/semantics/customize38.py    2020-06-17 
16:15:58.000000000 +0200
@@ -50,12 +50,24 @@
             "%|%c\n", 0
         ),
 
+        "except_cond_as": (
+            "%|except %c as %c:\n",
+            (1, "expr"),
+            (-2, "STORE_FAST"),
+            ),
+
         'except_handler38': (
             '%c', (2, 'except_stmts') ),
 
         'except_handler38a': (
             '%c', (-2, 'stmts') ),
 
+        "except_handler_as": (
+            "%c%+\n%+%c%-",
+            (1, "except_cond_as"),
+            (2, "tryfinallystmt"),
+        ),
+
         'except_ret38a': (
             'return %c', (4, 'expr') ),
 
@@ -105,6 +117,13 @@
         'try_except38': (
             '%|try:\n%+%c\n%-%|except:\n%|%-%c\n\n',
                    (-2, 'suite_stmts_opt'), (-1, 'except_handler38a') ),
+
+        "try_except_as": (
+            "%|try:\n%+%c%-\n%|%-%c\n\n",
+            (-4, "suite_stmts"),  # Go from the end because of POP_BLOCK 
variation
+            (-3, "except_handler_as"),
+        ),
+
         "try_except_ret38": (
             "%|try:\n%+%c%-\n%|except:\n%+%|%c%-\n\n",
             (1, "returns"),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/semantics/pysource.py 
new/uncompyle6-3.7.2/uncompyle6/semantics/pysource.py
--- old/uncompyle6-3.7.0/uncompyle6/semantics/pysource.py       2020-05-19 
07:36:47.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/semantics/pysource.py       2020-06-28 
05:16:06.000000000 +0200
@@ -895,6 +895,12 @@
         doc_node = node[0]
         if doc_node.attr:
             docstring = doc_node.attr
+            if not isinstance(docstring, str):
+                # FIXME: we have mistakenly tagged something as a doc
+                # string in transform when it isn't one.
+                # The rule in n_mkfunc is pretty flaky.
+                self.prune()
+                return
         else:
             docstring = node[0].pattr
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/semantics/transform.py 
new/uncompyle6-3.7.2/uncompyle6/semantics/transform.py
--- old/uncompyle6-3.7.0/uncompyle6/semantics/transform.py      2020-04-18 
23:55:36.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6/semantics/transform.py      2020-06-28 
05:13:34.000000000 +0200
@@ -95,10 +95,18 @@
 
         code = find_code_node(node, code_index).attr
 
+        mkfunc_pattr = node[-1].pattr
+        if isinstance(mkfunc_pattr, tuple):
+            assert len(mkfunc_pattr, 4) and isinstance(mkfunc_pattr, int)
+            is_closure = node[-1].pattr[3] != 0
+        else:
+            # FIXME: This is what we had before. It is hoaky and probably 
wrong.
+            is_closure = mkfunc_pattr == "closure"
+
         if (
-            node[-1].pattr != "closure"
+            (not is_closure)
             and len(code.co_consts) > 0
-            and code.co_consts[0] is not None
+            and isinstance(code.co_consts[0], str)
         ):
             docstring_node = SyntaxTree(
                 "docstring", [Token("LOAD_STR", has_arg=True, 
pattr=code.co_consts[0])]
@@ -433,6 +441,7 @@
                     ast[i] = ast[i][0]
 
                 if is_docstring(self.ast[i]):
+                    load_const = self.ast[i].first_child()
                     docstring_ast = SyntaxTree(
                         "docstring",
                         [
@@ -440,8 +449,8 @@
                                 "LOAD_STR",
                                 has_arg=True,
                                 offset=0,
-                                attr=self.ast[i][0][0].attr,
-                                pattr=self.ast[i][0][0].pattr,
+                                attr=load_const.attr,
+                                pattr=load_const.pattr,
                             )
                         ],
                     )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6/version.py 
new/uncompyle6-3.7.2/uncompyle6/version.py
--- old/uncompyle6-3.7.0/uncompyle6/version.py  2020-05-19 07:22:08.000000000 
+0200
+++ new/uncompyle6-3.7.2/uncompyle6/version.py  2020-06-28 05:13:43.000000000 
+0200
@@ -12,4 +12,4 @@
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # This file is suitable for sourcing inside POSIX shell as
 # well as importing into Python
-VERSION="3.7.0"  # noqa
+VERSION="3.7.2"  # noqa
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6.egg-info/PKG-INFO 
new/uncompyle6-3.7.2/uncompyle6.egg-info/PKG-INFO
--- old/uncompyle6-3.7.0/uncompyle6.egg-info/PKG-INFO   2020-05-19 
07:36:59.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6.egg-info/PKG-INFO   2020-06-28 
05:18:16.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: uncompyle6
-Version: 3.7.0
+Version: 3.7.2
 Summary: Python cross-version byte-code decompiler
 Home-page: https://github.com/rocky/python-uncompyle6/
 Author: Rocky Bernstein, Hartmut Goebel, John Aycock, and others
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6.egg-info/SOURCES.txt 
new/uncompyle6-3.7.2/uncompyle6.egg-info/SOURCES.txt
--- old/uncompyle6-3.7.0/uncompyle6.egg-info/SOURCES.txt        2020-05-19 
07:36:59.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6.egg-info/SOURCES.txt        2020-06-28 
05:18:16.000000000 +0200
@@ -948,6 +948,7 @@
 test/bytecode_3.7/02_kwargs.pyc
 test/bytecode_3.7/03_async_await.pyc
 test/bytecode_3.7/03_double_star_unpack.pyc
+test/bytecode_3.7/03_else_removal.pyc
 test/bytecode_3.7/03_weird26.pyc
 test/bytecode_3.7/03_while-if-break.pyc
 test/bytecode_3.7/04_call_function.pyc
@@ -1001,6 +1002,7 @@
 test/bytecode_3.8/02_tryfinally_return.pyc
 test/bytecode_3.8/02_while_and.pyc
 test/bytecode_3.8/03_async_await.pyc
+test/bytecode_3.8/03_else_removal.pyc
 test/bytecode_3.8/03_if_try.pyc
 test/bytecode_3.8/03_pop_top.pyc
 test/bytecode_3.8/04_async.pyc
@@ -1519,6 +1521,7 @@
 test/simple_source/bug33/05_store_locals.py
 test/simple_source/bug33/08_if_else.py
 test/simple_source/bug33/10_while1_popblock.py
+test/simple_source/bug33/__pycache__/04_lambda_star_default.cpython-32.pyc
 test/simple_source/bug34/05_while1_if_continue.py
 test/simple_source/bug34/08_while_if.py
 test/simple_source/bug35/01_loop_if_continue.py
@@ -1582,6 +1585,7 @@
 test/simple_source/bug37/02_and_or.py
 test/simple_source/bug37/02_async_for_generator.py
 test/simple_source/bug37/02_if_not_or.py
+test/simple_source/bug37/03_else_removal.py
 test/simple_source/bug37/03_ifelse_chained_for.py
 test/simple_source/bug37/03_jump_to_jump.py
 test/simple_source/bug37/04_grammar.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/uncompyle6-3.7.0/uncompyle6.egg-info/requires.txt 
new/uncompyle6-3.7.2/uncompyle6.egg-info/requires.txt
--- old/uncompyle6-3.7.0/uncompyle6.egg-info/requires.txt       2020-05-19 
07:36:59.000000000 +0200
+++ new/uncompyle6-3.7.2/uncompyle6.egg-info/requires.txt       2020-06-28 
05:18:16.000000000 +0200
@@ -1,2 +1,2 @@
 spark-parser<1.9.0,>=1.8.9
-xdis<4.7.0,>=4.6.0
+xdis<5.1.0,>=4.7.0


Reply via email to