Browse Source

Fixes task package upgrade again

Ask Solem 13 năm trước cách đây
mục cha
commit
0c040b9119
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      setup.py

+ 3 - 2
setup.py

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