[Zope-Checkins] CVS: Packages/SearchIndex/tests - testUnTextIndex.py:1.5.32.2

Jeffrey P Shell jeffrey@Digicool.com
Fri, 3 Aug 2001 14:10:58 -0400


Update of /cvs-repository/Packages/SearchIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv24726

Modified Files:
      Tag: Zope-2_4-branch
	testUnTextIndex.py 
Log Message:
Collector issue #2461: Changed another use of os.system() to a
glob()/os.remove() pair.  Pointed out by Chris Withers.

 
=== Packages/SearchIndex/tests/testUnTextIndex.py 1.5.32.1 => 1.5.32.2 ===
 ##############################################################################
 
-import sys, os
+import sys, os, glob, unittest
 
 sys.path.insert(0, os.getcwd())
-try: import unittest
+try: import zLOG
 except:
     sys.path[0]=os.path.join(sys.path[0],'..','..')
-    import unittest
-
+    import zLOG
+    
 class Dummy:
 
     def __init__(self, **kw):
         self.__dict__.update(kw)
 
-import zLOG
-
 def log_write(subsystem, severity, summary, detail, error):
     if severity >= zLOG.PROBLEM:
         assert 0, "%s(%s): %s" % (subsystem, severity, summary)
@@ -134,7 +132,8 @@
        get_transaction().abort()
        if hasattr(self, 'jar'):
            self.dbclose()
-           os.system('rm -f fs_tmp__*')
+           for fn in glob.glob('fs_tmp__*'):
+               os.remove(fn)
 
    def checkSimpleAddDelete(self):
        "Check that we can add and delete an object without error"