Python 3 compatible formatting in unique_path

This commit is contained in:
Adrian Sampson 2016-06-29 22:53:51 -07:00
parent 386f582364
commit cec632f359

View file

@ -496,7 +496,8 @@ def unique_path(path):
num = 0
while True:
num += 1
new_path = b'%s.%i%s' % (base, num, ext)
suffix = u'.{}'.format(num).encode() + ext
new_path = base + suffix
if not os.path.exists(new_path):
return new_path