From: stevenknight Date: Tue, 23 Apr 2002 03:05:50 +0000 (+0000) Subject: Fix attempts to unlink directories when unzipping an archive. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=167b7521db2b4051002b78c27a706c71ae4c6acf;p=scons.git Fix attempts to unlink directories when unzipping an archive. git-svn-id: http://scons.tigris.org/svn/scons/trunk@343 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/SConstruct b/SConstruct index e41bf1e0..4d91bb3d 100644 --- a/SConstruct +++ b/SConstruct @@ -204,9 +204,10 @@ try: print dest,name # if the file exists, then delete it before writing # to it so that we don't end up trying to write to a symlink: - if os.path.exists(dest): + if os.path.isfile(dest) or os.path.islink(dest): os.unlink(dest) - open(dest, 'w').write(zf.read(name)) + if not os.path.isdir(dest): + open(dest, 'w').write(zf.read(name)) except: if unzip and zip: