From 73483ed5a030403355dcbc205df20e9f22a82e75 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Thu, 1 Nov 2012 14:10:41 +1100 Subject: [PATCH] Fix errors on Windows. Catch the correct exception. --- sb/build.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sb/build.py b/sb/build.py index d425f5b..5af1178 100644 --- a/sb/build.py +++ b/sb/build.py @@ -108,7 +108,9 @@ class build: try: shutil.rmtree(path.host(rmpath)) except IOError, err: - raise error.error('error removing: %s' % (path.host(rmpath))) + raise error.error('error removing: %s' % (rmpath)) + except WindowsError, err: + _notice(self.opts, 'warning: cannot remove: %s' % (rmpath)) def mkdir(self, mkpath): self._output('making dir: %s' % (path.host(mkpath))) @@ -116,7 +118,9 @@ class build: try: os.makedirs(path.host(mkpath)) except IOError, err: - raise error.general('error creating path: %s' % (path.host(path))) + _notice(self.opts, 'warning: cannot make directory: %s' % (mkpath)) + except WindowsError, err: + _notice(self.opts, 'warning: cannot make directory: %s' % (mkpath)) def get_file(self, url, local): if not path.isdir(path.dirname(local)):