Bläddra i källkod

Fixes task package upgrade again

Ask Solem 13 år sedan
förälder
incheckning
0c040b9119
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      setup.py

+ 3 - 2
setup.py

@@ -16,14 +16,15 @@ try:
         except ValueError:
             pass
     try:
-        import imp
         import celery.app
+        import imp
+        import shutil
         _, task_path, _ = imp.find_module("task", celery.app.__path__)
         if task_path.endswith("/task"):
             print("- force upgrading previous installation")
             print("  - removing %r package..." % task_path)
             try:
-                os.unlink(os.path.abspath(task_path))
+                shutil.rmtree(os.path.abspath(task_path))
             except Exception, exc:
                 sys.stderr.write("Couldn't remove %r: %r\n" % (task_path, exc))
     finally: