mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-11-26 22:50:40 +00:00
Better testing of named %c format specifiers
This commit is contained in:
parent
15533c5e38
commit
e76f1f107f
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
PYTHON_VERSION=3.6.4
|
||||
PYTHON_VERSION=3.6.5
|
||||
|
||||
# FIXME put some of the below in a common routine
|
||||
function finish {
|
||||
|
@ -1620,12 +1620,14 @@ class FragmentsWalker(pysource.SourceWalker, object):
|
||||
index = entry[arg]
|
||||
if isinstance(index, tuple):
|
||||
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])
|
||||
)
|
||||
index = index[0]
|
||||
if isinstance(index, int):
|
||||
self.preorder(node[index])
|
||||
assert isinstance(index, int), (
|
||||
"at %s[%d], %s should be int or tuple" % (
|
||||
node.kind, arg, type(index)))
|
||||
self.preorder(node[index])
|
||||
|
||||
finish = len(self.f.getvalue())
|
||||
self.set_pos_info(node, start, finish)
|
||||
|
@ -1744,12 +1744,15 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
index = entry[arg]
|
||||
if isinstance(index, tuple):
|
||||
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])
|
||||
)
|
||||
index = index[0]
|
||||
if isinstance(index, int):
|
||||
self.preorder(node[index])
|
||||
assert isinstance(index, int), (
|
||||
"at %s[%d], %s should be int or tuple" % (
|
||||
node.kind, arg, type(index)))
|
||||
self.preorder(node[index])
|
||||
|
||||
arg += 1
|
||||
elif typ == 'p':
|
||||
p = self.prec
|
||||
|
Loading…
Reference in New Issue
Block a user