OK, so a can be anything, not just a directory

This commit is contained in:
Martin A. Brown 2016-03-07 18:54:08 -08:00
parent 87e1161212
commit bd7b08ce23
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ def swapdirs(a, b):
if not os.path.isdir(a):
raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), a)
tname = None
if os.path.isdir(b):
if os.path.exists(b):
tdir = mkdtemp(prefix='swapdirs-', dir=opd(opa(a)))
logger.debug("Created tempdir %s.", tdir)
tname = opj(tdir, opb(b))