From e784e672ef99a5613b19fd210dd8f133ee6a39fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Sch=C3=BCtt?= Date: Thu, 7 Apr 2016 08:49:54 +0000 Subject: [PATCH] prettfiy: Fix selftest, mkstemp() creates invalid module names svn-origin-rev: 16803 --- tools/formatting/selftest.py | 2 +- tools/prettify.py | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tools/formatting/selftest.py b/tools/formatting/selftest.py index eae7e1da61..7d8434ad49 100644 --- a/tools/formatting/selftest.py +++ b/tools/formatting/selftest.py @@ -1,6 +1,6 @@ content = """ -MODULE module_name +MODULE prettify_selftest IMPLICIT NONE PRIVATE PUBLIC :: dp, test_routine, & diff --git a/tools/prettify.py b/tools/prettify.py index e77ca1eabe..8d45b991a3 100755 --- a/tools/prettify.py +++ b/tools/prettify.py @@ -306,13 +306,9 @@ def main(argv): #========================================================================= def run_selftest(): - # create temporary file - fh, fn = tempfile.mkstemp(suffix=".F") - mod_name = os.path.basename(fn)[:-2] - - # fill file with example code + # create temporary file with example code + fn = os.path.join(tempfile.gettempdir(), "prettify_selftest.F") ref = selftest.content - ref = ref.replace("module_name", mod_name) f = open(fn, "w") f.write(ref) f.close()