]> granicus.if.org Git - python/commitdiff
Make it work with Py3k.
authorGuido van Rossum <guido@python.org>
Wed, 29 Aug 2007 23:37:34 +0000 (23:37 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 29 Aug 2007 23:37:34 +0000 (23:37 +0000)
Tools/scripts/dutree.py

index c51f105b019d2bc762f1c1b66d96571cd7738d8a..dbf4f1aa6c1e5fb5864c9776ff3dd0323232d975 100755 (executable)
@@ -25,7 +25,7 @@ def main():
 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 @@ def show(total, d, prefix):
         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__':