From b86d31ade5e8284df1efe339890b674eedf89bcd Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Fri, 3 May 2024 17:26:18 -0700 Subject: [PATCH] gnulib-tool.py: Fix an undefined function name. * pygnulib/main.py (main_with_exception_handling): Use the tempfile module prefix when calling mkdtemp(). Use the 'glpy' prefix for the temporary directory that exists for the entirety of the program. --- ChangeLog | 7 +++++++ pygnulib/main.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2781a70800..96b29b7fc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-05-03 Collin Funk + + gnulib-tool.py: Fix an undefined function name. + * pygnulib/main.py (main_with_exception_handling): Use the tempfile + module prefix when calling mkdtemp(). Use the 'glpy' prefix for the + temporary directory that exists for the entirety of the program. + 2024-05-03 Simon Josefsson maint.mk: Don't fail on ~/.indent.pro, reported by Collin Funk. diff --git a/pygnulib/main.py b/pygnulib/main.py index d429a2c47e..66bd67ea59 100644 --- a/pygnulib/main.py +++ b/pygnulib/main.py @@ -1364,7 +1364,7 @@ def main(temp_directory: str) -> None: def main_with_exception_handling() -> None: try: # Try to execute - with tempfile.TemporaryDirectory() as temporary_directory: + with tempfile.TemporaryDirectory(prefix='glpy') as temporary_directory: main(temporary_directory) except GLError as error: errmode = 0 # gnulib-style errors @@ -1404,7 +1404,7 @@ def main_with_exception_handling() -> None: incompatibilities += pair[0] incompatibilities += ' %s' % pair[1] incompatibilities += '\n' - tempname = mktemp() + tempname = tempfile.mktemp() with open(tempname, mode='w', newline='\n', encoding='utf-8') as file: file.write(incompatibilities) sed_table = 's,^\\([^ ]*\\) ,\\1' + ' ' * 51 + ',\n' -- 2.11.4.GIT