Merge pull request #364 from rocky/PYTHON3-move

use xdis.PYTHON3 not uncompyle.PYTHON3
This commit is contained in:
R. Bernstein
2021-11-02 06:57:29 -04:00
committed by rocky
25 changed files with 41 additions and 56 deletions

View File

@@ -84,8 +84,8 @@ check-3.10: check-bytecode
@echo "Note that we do not support decompiling Python 3.10 bytecode - no 3.10 tests run"
# FIXME
#: this is called when running under pypy3.5-5.8.0, pypy2-5.6.0, or pypy3.6-7.3.0
5.8 5.6:
#: this is called when running under pypy3.5-5.8.0, pypy2-5.6.0, pypy3.6-7.3.0 or pypy3.8-7.3.7
5.8 5.6 7.3:
#: Check deparsing only, but from a different Python version
check-disasm:

View File

@@ -14,11 +14,11 @@ def a():
def c():
k = 34
global i
i += k
i = i+k
l = 42
c()
global j
j += l
j = j+l
b()
print i, j # should print 35, 49

View File

@@ -8,7 +8,7 @@
def f():
print x # would result in a 'NameError' or 'UnboundLocalError'
x += 1
x = x+1
print x
raise "This program can't be run"

View File

@@ -28,7 +28,7 @@ else:
i = 0
while i < 10:
i += 1
i = i+1
if i == 3:
continue
if i == 5:
@@ -40,7 +40,7 @@ print
i = 0
while i < 10:
i += 1
i = i+1
if i == 3:
continue
print i,

View File

@@ -55,9 +55,9 @@ class DBRecIO:
if self.closed:
raise ValueError, "I/O operation on closed file"
if mode == 1:
pos += self.pos
pos = pos + self.pos
elif mode == 2:
pos += self.len
pos = pos + self.len
self.pos = max(0, pos)
def tell(self):
@@ -84,7 +84,7 @@ class DBRecIO:
if self.closed:
raise ValueError, "I/O operation on closed file"
if self.buflist:
self.buf += string.joinfields(self.buflist, '')
self.buf = self.buf + string.joinfields(self.buflist, '')
self.buflist = []
i = string.find(self.buf, '\n', self.pos)
if i < 0:

View File

@@ -3,7 +3,7 @@ def flatten(tup):
elts = []
for elt in tup:
if isinstance(elt, tuple):
elts += flatten(elt)
elts = elts + flatten(elt)
else:
elts.append(elt)
return elts
@@ -53,7 +53,7 @@ def mangle(name, klass):
try:
i = 0
while klass[i] == '_':
i += 1
i = i + 1
except IndexError:
return name
klass = klass[i:]

View File

@@ -30,7 +30,7 @@ class SyntaxErrorChecker:
self.errors = 0
def error(self, node, msg):
self.errors += 1
self.errors = self.errors + 1
if self.multi is not None:
print "%s:%s: %s" % (node.filename, node.lineno, msg)
else:

View File

@@ -9,11 +9,11 @@ def normpath(comps):
del comps[i]
elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'):
del comps[i-1:i+1]
i -= 1
i = i - 1
elif comps[i] == '' and i > 0 and comps[i-1] != '':
del comps[i]
else:
i += 1
i = i + 1
return comps
assert normpath(['.']) == []

View File

@@ -2,7 +2,7 @@
# messing up control flow detection
def _format_usage(self, usage, actions, groups, prefix):
if usage:
usage %= dict(prog=self._prog)
usage = usage % dict(prog=self._prog)
elif usage is None:
prog = 5

View File

@@ -31,9 +31,9 @@ from __future__ import print_function
import getopt, os, py_compile, sys, shutil, tempfile, time
from uncompyle6 import PYTHON_VERSION
from uncompyle6.main import main
from fnmatch import fnmatch
from uncompyle6.main import main
from xdis.version_info import PYTHON_VERSION
def get_srcdir():