Another 3.x bug involving jumps

This commit is contained in:
rocky
2016-06-19 17:47:43 -04:00
parent 109d99bc62
commit bd809dc08b
3 changed files with 24 additions and 4 deletions

View File

@@ -0,0 +1,19 @@
# Python 3.4 bug found from tempfile.py
def _get_default_tempdir(dirlist, fd):
for dir in dirlist:
for seq in range(100):
try:
try:
try:
with open(fd, 'wb', closefd=False) as fp:
fp.write(b'blat')
finally:
seq += 1
finally:
seq += 10
return dir
except RuntimeError:
pass
except OSError:
break # no point trying more names in this directory
raise RuntimeError