use list(x) instead of x.tolist()

This commit is contained in:
jomo
2014-06-29 09:19:33 +02:00
parent 4313bb90fd
commit 45f105ec61
2 changed files with 2 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ def msg(player, text, usecolor = True, basecolor = None):
# bukkit only works with permissibles that are subscribed to perm
def broadcast(perm, text):
text = colorify(text)
for recipient in server.getOnlinePlayers().tolist() + [server.getConsoleSender()]:
for recipient in list(server.getOnlinePlayers()) + [server.getConsoleSender()]:
(not perm or recipient.hasPermission(perm)) and msg(recipient, text)
def colorify(text):

View File

@@ -206,7 +206,7 @@ def onDonateCommand(sender, args):
@hook.command("pluginversions")
def onPluginversionsCommand(sender, args):
plugHeader(sender, "Plugin versions")
plugins = server.getPluginManager().getPlugins().tolist()
plugins = list(server.getPluginManager().getPlugins())
plugins.sort(key=lambda pl: pl.getName())
msg(sender, "&3Listing all " + str(len(plugins)) + " plugins and their version:")
for plugin in plugins: