瀏覽代碼

Fix parsing of arguments in SmartList.sort()

tags/v0.2
Ben Kurtovic 11 年之前
父節點
當前提交
fb92349909
共有 1 個文件被更改,包括 7 次插入9 次删除
  1. +7
    -9
      mwparserfromhell/smart_list.py

+ 7
- 9
mwparserfromhell/smart_list.py 查看文件

@@ -168,16 +168,14 @@ class SmartList(list):
copy = list(self)
for child in self._children:
child._parent = copy
kwargs = {}
if cmp is not None:
if key is not None:
if reverse is not None:
super(SmartList, self).sort(cmp, key, reverse)
else:
super(SmartList, self).sort(cmp, key)
else:
super(SmartList, self).sort(cmp)
else:
super(SmartList, self).sort()
kwargs["cmp"] = cmp
if key is not None:
kwargs["key"] = key
if reverse is not None:
kwargs["reverse"] = reverse
super(SmartList, self).sort(**kwargs)


class _ListProxy(list):


Loading…
取消
儲存