]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
Adapt 'insert_copyright' for python 3
authorGilles DAVID <gilles-g.david@edf.fr>
Fri, 22 Sep 2017 15:36:06 +0000 (17:36 +0200)
committerGilles DAVID <gilles-g.david@edf.fr>
Fri, 22 Sep 2017 15:36:06 +0000 (17:36 +0200)
copyright/insert_copyright

index 87a44b2cca775698c1a26b508ad0aa6225b90f27..41886b0a568e6e0fb1840738e8e560c29ac8cf1f 100755 (executable)
@@ -205,8 +205,14 @@ def autodetect_owner(filename):
         while directory != '/':
             config_file = os.path.join(directory, '.git', 'config')
             if os.path.exists(config_file):
-                from ConfigParser import ConfigParser
-                from StringIO import StringIO
+                try:
+                    from ConfigParser import ConfigParser
+                except ImportError:
+                    from configparser import ConfigParser
+                try:
+                    from StringIO import StringIO
+                except ImportError:
+                    from io import StringIO
                 with open(config_file) as fid:
                     gitcfg = fid.readlines()
                     cfg = ConfigParser()