This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.28.9000-230-g954cf3c
- From: jsm28 at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 29 Oct 2018 17:49:37 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.28.9000-230-g954cf3c
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 954cf3c29bd0b32bd11d5235b7e36148b187e77d (commit)
from c6982f7efc1c70fe2d6160a87ee44d871ac85ab0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=954cf3c29bd0b32bd11d5235b7e36148b187e77d
commit 954cf3c29bd0b32bd11d5235b7e36148b187e77d
Author: Joseph Myers <joseph@codesourcery.com>
Date: Mon Oct 29 17:49:07 2018 +0000
Use tempfile.TemporaryDirectory in conform/glibcconform.py.
Now that we require Python 3.4 or later, Python code creating
temporary directories can use tempfile.TemporaryDirectory in "with" to
have the directory deleted automatically instead of needing to use
try/finally to handle removing a directory created with
tempfile.mkdtemp. This patch does so in conform/glibcconform.py.
Tested for x86_64.
* conform/glibcconform.py: Do not import shutil.
(list_exported_functions): Use tempfile.TemporaryDirectory instead
of mkdtemp.
diff --git a/ChangeLog b/ChangeLog
index dc267e2..944d8fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
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.
diff --git a/conform/glibcconform.py b/conform/glibcconform.py
index 31ad4a9..c1db460 100644
--- a/conform/glibcconform.py
+++ b/conform/glibcconform.py
@@ -19,7 +19,6 @@
import os.path
import re
-import shutil
import subprocess
import tempfile
@@ -43,11 +42,9 @@ def list_exported_functions(cc, standard, header):
"""
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()
@@ -72,6 +69,4 @@ def list_exported_functions(cc, standard, header):
else:
raise ValueError("couldn't parse -aux-info output: %s"
% line)
- finally:
- shutil.rmtree(temp_dir)
return fns
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 ++++
conform/glibcconform.py | 11 +++--------
2 files changed, 7 insertions(+), 8 deletions(-)
hooks/post-receive
--
GNU C Library master sources