Misc: long lists, DRY 2/3 grammars, '%' count

parse{2,3,r}.py: DRY Python expressions between Python 2 and 3
pysource.py, fragment.py, parser.py: handle long lists by grouping in chunks of 32
and 256
bin/uncompyle6: count %s properly
This commit is contained in:
rocky
2016-05-02 21:20:17 -04:00
parent ceb47aba9c
commit feec241da8
10 changed files with 210 additions and 291 deletions

View File

@@ -118,14 +118,14 @@ def main(in_base, out_base, files, codes, outfile=None,
os.remove(outfile)
sys.stderr.write("\nLast file: %s " % (infile))
raise
except:
failed_files += 1
if outfile:
outstream.close()
os.rename(outfile, outfile + '_failed')
else:
sys.stderr.write("\n# %s" % sys.exc_info()[1])
sys.stderr.write("\n# Can't uncompile %s\n" % infile)
# except:
# failed_files += 1
# if outfile:
# outstream.close()
# os.rename(outfile, outfile + '_failed')
# else:
# sys.stderr.write("\n# %s" % sys.exc_info()[1])
# sys.stderr.write("\n# Can't uncompile %s\n" % infile)
else: # uncompile successful
if outfile:
outstream.close()