mirror of https://github.com/tLDP/python-tldp
do not allow None as the b argument (crazy)
This commit is contained in:
parent
99d93fb4ce
commit
be78491fd6
|
@ -85,7 +85,7 @@ def swapdirs(a, b):
|
||||||
if not os.path.isdir(a):
|
if not os.path.isdir(a):
|
||||||
raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), a)
|
raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), a)
|
||||||
tname = None
|
tname = None
|
||||||
if b and os.path.exists(b):
|
if os.path.exists(b):
|
||||||
tdir = mkdtemp(prefix='swapdirs-', dir=opd(opa(a)))
|
tdir = mkdtemp(prefix='swapdirs-', dir=opd(opa(a)))
|
||||||
logger.debug("Created tempdir %s.", tdir)
|
logger.debug("Created tempdir %s.", tdir)
|
||||||
tname = opj(tdir, opb(b))
|
tname = opj(tdir, opb(b))
|
||||||
|
|
Loading…
Reference in New Issue