samba-tool: max() with key option is available in python >= 2.6
[samba.git] / source4 / scripting / python / samba / netcmd / __init__.py
index d4f9b4b7102a0f39fe15e646dbe84a0ac05f18d5..288993f561d59f1b3917db4943c3f0381a2395f4 100644 (file)
@@ -162,7 +162,7 @@ class SuperCommand(Command):
         print "Available subcommands:"
         subcmds = self.subcommands.keys()
         subcmds.sort()
-        max_length = len(max(subcmds, key=len))
+        max_length = max(map(lambda c: len(c), subcmds))
         for cmd in subcmds:
             print "  %*s  - %s" % (-max_length, cmd, self.subcommands[cmd].description)
         print " *  server connection needed"