prettfiy: Fix selftest, mkstemp() creates invalid module names

svn-origin-rev: 16803
This commit is contained in:
Ole Schütt 2016-04-07 08:49:54 +00:00
parent 9301432c5b
commit e784e672ef
2 changed files with 3 additions and 7 deletions

View file

@ -1,6 +1,6 @@
content = """
MODULE module_name
MODULE prettify_selftest
IMPLICIT NONE
PRIVATE
PUBLIC :: dp, test_routine, &

View file

@ -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()