Jelajahi Sumber

Fixes task package upgrade again

Ask Solem 13 tahun lalu
induk
melakukan
0c040b9119
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  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: