From 19b4e6d57fec740b45361739798bef0c1d5ce77e Mon Sep 17 00:00:00 2001
From: Karl-Hermann Wieners <karl-hermann.wieners@mpimet.mpg.de>
Date: Wed, 15 Jun 2022 16:52:09 +0200
Subject: [PATCH] mkexp: python2 compatibility (print future, str.isidentifier)

---
 mkexp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mkexp b/mkexp
index 652a902..64de09a 100755
--- a/mkexp
+++ b/mkexp
@@ -5,6 +5,8 @@
 # $Id$
 #
 
+from __future__ import print_function
+
 import copy
 import io
 import os
@@ -227,7 +229,7 @@ def format_vars(section, key, log, fmt):
 
     def replace(match):
         result = match.group(1)
-        if result.isidentifier():
+        if re.match(r'[_A-Za-z][_A-Za-z0-9]*$', result):
             log.add(result)
             return fmt%result
         return result
-- 
GitLab