Merge pull request #40193 from rallytime/bp-40117

Back-port #40117 to 2016.3
This commit is contained in:
Mike Place 2017-03-22 10:42:21 -06:00 committed by GitHub
commit d1abb4cbaa

View file

@ -2059,7 +2059,11 @@ def directory(name,
if not os.path.isabs(name):
return _error(
ret, 'Specified file {0} is not an absolute path'.format(name))
if os.path.isfile(name) or (not allow_symlink and os.path.islink(name)):
# Check for existing file or symlink
if os.path.isfile(name) or (not allow_symlink and os.path.islink(name)) \
or (force and os.path.islink(name)):
# Was a backupname specified
if backupname is not None:
# Make a backup first
if os.path.lexists(backupname):