[Python-3000-checkins] r57687 - python/branches/py3k/Tools/scripts/dutree.py
guido.van.rossum
python-3000-checkins at python.org
Thu Aug 30 01:37:35 CEST 2007
Author: guido.van.rossum
Date: Thu Aug 30 01:37:34 2007
New Revision: 57687
Modified:
python/branches/py3k/Tools/scripts/dutree.py
Log:
Make it work with Py3k.
Modified: python/branches/py3k/Tools/scripts/dutree.py
==============================================================================
--- python/branches/py3k/Tools/scripts/dutree.py (original)
+++ python/branches/py3k/Tools/scripts/dutree.py Thu Aug 30 01:37:34 2007
@@ -25,7 +25,7 @@
def store(size, comps, total, d):
if comps == []:
return size, d
- if not d.has_key(comps[0]):
+ if comps[0] not in d:
d[comps[0]] = None, {}
t1, d1 = d[comps[0]]
d[comps[0]] = store(size, comps[1:], t1, d1)
@@ -53,7 +53,7 @@
else:
print(prefix + repr(tsub).rjust(width) + ' ' + key)
psub = prefix + ' '*(width-1) + '|' + ' '*(len(key)+1)
- if d.has_key(key):
+ if key in d:
show(tsub, d[key][1], psub)
if __name__ == '__main__':
More information about the Python-3000-checkins
mailing list