Closed voyageth closed 7 years ago
On Mac OSX, if convert_svhn_format_1 method's output_directory parameter is not exist on file system, 'no such file or directory' exception is ignored.
import os import tempfile import h5py
try: output_path = os.path.join('test', 'test.txt') h5file = h5py.File(output_path, mode='w') TMPDIR = tempfile.mkdtemp() finally: if os.path.isdir(TMPDIR): shutil.rmtree(TMPDIR) h5file.flush() h5file.close()
NameError Traceback (most recent call last)
I think this PR is good. I'll check if someone else from fuel dev can merge this.
thanks for the PR.
Yup, we should be careful in finally, thanks!
finally
On Mac OSX, if convert_svhn_format_1 method's output_directory parameter is not exist on file system, 'no such file or directory' exception is ignored.
del TMPDIR
TMPDIR=''
try: output_path = os.path.join('test', 'test.txt') h5file = h5py.File(output_path, mode='w') TMPDIR = tempfile.mkdtemp() finally: if os.path.isdir(TMPDIR): shutil.rmtree(TMPDIR) h5file.flush() h5file.close()
NameError Traceback (most recent call last)