Merged revisions 82766 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

Since 'purge' is an API change, modified it to be _purge for 3.1
and deleted the doc update.

........
  r82766 | r.david.murray | 2010-07-10 09:52:13 -0400 (Sat, 10 Jul 2010) | 5 lines

  Fix 'refleak' introduced by fnmatch cache purge tests.

  This introduces a 'purge' function for the fnmatch module analogous
  to the 'purge' function in the re module.
........
diff --git a/Lib/test/test_fnmatch.py b/Lib/test/test_fnmatch.py
index f2966ad..abf8811 100644
--- a/Lib/test/test_fnmatch.py
+++ b/Lib/test/test_fnmatch.py
@@ -3,10 +3,14 @@
 from test import support
 import unittest
 
-from fnmatch import fnmatch, fnmatchcase, _MAXCACHE, _cache, _cacheb
+from fnmatch import fnmatch, fnmatchcase, _MAXCACHE, _cache, _cacheb, _purge
 
 
 class FnmatchTestCase(unittest.TestCase):
+
+    def tearDown(self):
+        _purge()
+
     def check_match(self, filename, pattern, should_match=1):
         if should_match:
             self.assertTrue(fnmatch(filename, pattern),