mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 22:25:32 -04:00
prettfiy: Fix selftest, mkstemp() creates invalid module names
svn-origin-rev: 16803
This commit is contained in:
parent
9301432c5b
commit
e784e672ef
2 changed files with 3 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
content = """
|
||||
MODULE module_name
|
||||
MODULE prettify_selftest
|
||||
IMPLICIT NONE
|
||||
PRIVATE
|
||||
PUBLIC :: dp, test_routine, &
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue