r84759 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84758‎ | r84759 | r84760 >
Date:19:46, 25 March 2011
Author:diederik
Status:deferred
Tags:
Comment:
Fixed a small memory leak.
Modified paths:
  • /trunk/tools/editor_trends/etl/enricher.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/etl/enricher.py
@@ -321,12 +321,16 @@
322322 counts.setdefault(contributor['username'], 0)
323323 counts[contributor['username']] += 1
324324
 325+ clear_xml_elements(article)
 326+ return counts
 327+
 328+
 329+def clear_xml_elements(article):
325330 for elem in article:
326 - elem.clear()
 331+ if type(elem) != type('str'):
 332+ elem.clear()
327333
328 - return counts
329334
330 -
331335 def create_variables(article, cache, bots):
332336 title = article['title']
333337 namespace = determine_namespace(title)

Status & tagging log