src/setup.py
changeset 454 c27abbc11c8c
parent 452 01f53c6381af
child 465 44fddb622fe4
--- a/src/setup.py	Wed Aug 06 14:25:40 2008 -0700
+++ b/src/setup.py	Wed Aug 06 17:55:19 2008 -0500
@@ -23,6 +23,7 @@
 # Use is subject to license terms.
 #
 
+import fnmatch
 import os
 import platform
 import stat
@@ -308,9 +309,12 @@
                         cwd = CPDIR).wait()
 
 def remove_cherrypy():
-        if os.path.exists(CPARC):
-                os.unlink(CPARC)
-        shutil.rmtree(CPDIR, True)
+        for file in os.listdir("."):
+                if fnmatch.fnmatch(file, "%s*" % CP):
+                        if os.path.isfile(file):
+                                os.unlink(file)
+                        else:
+                                shutil.rmtree(file, True)
 
 class build_func(_build):
         def initialize_options(self):