Explorar o código

Fixes task package upgrade again

Ask Solem %!s(int64=13) %!d(string=hai) anos
pai
achega
0c040b9119
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  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: