allow None as the b argument

This commit is contained in:
Martin A. Brown 2016-03-07 19:56:27 -08:00
parent 4fbc08c1be
commit 99d93fb4ce
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.exists(b):
if b and os.path.exists(b):
tdir = mkdtemp(prefix='swapdirs-', dir=opd(opa(a)))
logger.debug("Created tempdir %s.", tdir)
tname = opj(tdir, opb(b))