You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Better testing of named %c format specifiers
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PYTHON_VERSION=3.6.4
|
PYTHON_VERSION=3.6.5
|
||||||
|
|
||||||
# FIXME put some of the below in a common routine
|
# FIXME put some of the below in a common routine
|
||||||
function finish {
|
function finish {
|
||||||
|
@@ -1620,12 +1620,14 @@ class FragmentsWalker(pysource.SourceWalker, object):
|
|||||||
index = entry[arg]
|
index = entry[arg]
|
||||||
if isinstance(index, tuple):
|
if isinstance(index, tuple):
|
||||||
assert node[index[0]] == index[1], (
|
assert node[index[0]] == index[1], (
|
||||||
"at %s[%d], %s vs %s" % (
|
"at %s[%d], expected %s node; got %s" % (
|
||||||
node.kind, arg, node[index[0]].kind, index[1])
|
node.kind, arg, node[index[0]].kind, index[1])
|
||||||
)
|
)
|
||||||
index = index[0]
|
index = index[0]
|
||||||
if isinstance(index, int):
|
assert isinstance(index, int), (
|
||||||
self.preorder(node[index])
|
"at %s[%d], %s should be int or tuple" % (
|
||||||
|
node.kind, arg, type(index)))
|
||||||
|
self.preorder(node[index])
|
||||||
|
|
||||||
finish = len(self.f.getvalue())
|
finish = len(self.f.getvalue())
|
||||||
self.set_pos_info(node, start, finish)
|
self.set_pos_info(node, start, finish)
|
||||||
|
@@ -1744,12 +1744,15 @@ class SourceWalker(GenericASTTraversal, object):
|
|||||||
index = entry[arg]
|
index = entry[arg]
|
||||||
if isinstance(index, tuple):
|
if isinstance(index, tuple):
|
||||||
assert node[index[0]] == index[1], (
|
assert node[index[0]] == index[1], (
|
||||||
"at %s[%d], %s vs %s" % (
|
"at %s[%d], expected %s node; got %s" % (
|
||||||
node.kind, arg, node[index[0]].kind, index[1])
|
node.kind, arg, node[index[0]].kind, index[1])
|
||||||
)
|
)
|
||||||
index = index[0]
|
index = index[0]
|
||||||
if isinstance(index, int):
|
assert isinstance(index, int), (
|
||||||
self.preorder(node[index])
|
"at %s[%d], %s should be int or tuple" % (
|
||||||
|
node.kind, arg, type(index)))
|
||||||
|
self.preorder(node[index])
|
||||||
|
|
||||||
arg += 1
|
arg += 1
|
||||||
elif typ == 'p':
|
elif typ == 'p':
|
||||||
p = self.prec
|
p = self.prec
|
||||||
|
Reference in New Issue
Block a user