mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Make it work with Py3k.
This commit is contained in:
parent
3add4d78ff
commit
ba1fffac86
1 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ def main():
|
||||||
def store(size, comps, total, d):
|
def store(size, comps, total, d):
|
||||||
if comps == []:
|
if comps == []:
|
||||||
return size, d
|
return size, d
|
||||||
if not d.has_key(comps[0]):
|
if comps[0] not in d:
|
||||||
d[comps[0]] = None, {}
|
d[comps[0]] = None, {}
|
||||||
t1, d1 = d[comps[0]]
|
t1, d1 = d[comps[0]]
|
||||||
d[comps[0]] = store(size, comps[1:], t1, d1)
|
d[comps[0]] = store(size, comps[1:], t1, d1)
|
||||||
|
@ -53,7 +53,7 @@ def show(total, d, prefix):
|
||||||
else:
|
else:
|
||||||
print(prefix + repr(tsub).rjust(width) + ' ' + key)
|
print(prefix + repr(tsub).rjust(width) + ' ' + key)
|
||||||
psub = prefix + ' '*(width-1) + '|' + ' '*(len(key)+1)
|
psub = prefix + ' '*(width-1) + '|' + ' '*(len(key)+1)
|
||||||
if d.has_key(key):
|
if key in d:
|
||||||
show(tsub, d[key][1], psub)
|
show(tsub, d[key][1], psub)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue