Commit 426af7fd authored by Jason R. Coombs's avatar Jason R. Coombs

Merge pull request #545 from totoroliu/master

Handle not-zip-safe egg (folder) deletion in rotate command
parents 74f7b0b7 18b7ab63
...@@ -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