Commit 18b7ab63 authored by Rick Liu's avatar Rick Liu

Handle not-zip-safe egg (folder) deletion in rotate command

parent 4950c059
...@@ -2,6 +2,7 @@ from distutils.util import convert_path ...@@ -2,6 +2,7 @@ from distutils.util import convert_path
from distutils import log from distutils import log
from distutils.errors import DistutilsOptionError from distutils.errors import DistutilsOptionError
import os import os
import shutil
from setuptools.extern import six from setuptools.extern import six
...@@ -59,4 +60,7 @@ class rotate(Command): ...@@ -59,4 +60,7 @@ class rotate(Command):
for (t, f) in files: for (t, f) in files:
log.info("Deleting %s", f) log.info("Deleting %s", f)
if not self.dry_run: if not self.dry_run:
os.unlink(f) if os.path.isdir(f):
shutil.rmtree(f)
else:
os.unlink(f)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment