Files
python-uncompyle6/test/simple_source/exception/10_try_continue_bug.py
2016-06-19 17:47:43 -04:00

20 lines
629 B
Python

# 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