2018-10-29 Joseph Myers <joseph@codesourcery.com>
+ * conform/glibcconform.py: Do not import shutil.
+ (list_exported_functions): Use tempfile.TemporaryDirectory instead
+ of mkdtemp.
+
* configure.ac (PYTHON_PROG): Use AC_CHECK_PROG_VER. Set
critic_missing for versions before 3.4.
* configure: Regenerated.
import os.path
import re
-import shutil
import subprocess
import tempfile
"""
cc_all = '%s -D_ISOMAC %s' % (cc, CFLAGS[standard])
- # tempfile.TemporaryDirectory requires Python 3.2, so use mkdtemp.
- temp_dir = tempfile.mkdtemp()
- c_file_name = os.path.join(temp_dir, 'test.c')
- aux_file_name = os.path.join(temp_dir, 'test.c.aux')
- try:
+ with tempfile.TemporaryDirectory() as temp_dir:
+ c_file_name = os.path.join(temp_dir, 'test.c')
+ aux_file_name = os.path.join(temp_dir, 'test.c.aux')
with open(c_file_name, 'w') as c_file:
c_file.write('#include <%s>\n' % header)
fns = set()
else:
raise ValueError("couldn't parse -aux-info output: %s"
% line)
- finally:
- shutil.rmtree(temp_dir)
return fns