# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1562673877 -7200
#      Tue Jul 09 14:04:37 2019 +0200
# Node ID 07c327d902e5aad83d79a803b0f2edac80ef1ad9
# Parent  bc3421b5dccc00145e3aca81db6a48f4d6cc6b75
📝 use ConfigParser in python 3 instead of the deprecated SafeConfigParser

diff --git a/create_documentation b/create_documentation
--- a/create_documentation
+++ b/create_documentation
@@ -67,11 +67,10 @@
 
 if type "python3" > /dev/null;
 then
-    python=python3
+    odoo_modules="$(python3 -B -c "import configparser ; c = configparser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
 else
-    python=python2
+    odoo_modules="$(python2 -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
 fi
-odoo_modules="$($python -B -c "from six.moves import configparser ; c = configparser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
 
 for module_path in $(eval echo $odoo_modules) ;
 do
diff --git a/docker_build_clean b/docker_build_clean
--- a/docker_build_clean
+++ b/docker_build_clean
@@ -10,7 +10,7 @@
 project_home=$(cd $here && cd .. && echo $PWD)
 if type "python3" > /dev/null;
 then
-    odoo_modules="$(python3 -B -c "import configparser ; c = configparser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
+    odoo_modules="$(python3 -B -c "import configparser ; c = configparser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
 else
     odoo_modules="$(python2 -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
 fi
diff --git a/docker_build_copy b/docker_build_copy
--- a/docker_build_copy
+++ b/docker_build_copy
@@ -11,7 +11,7 @@
 static_dir=$project_home/static/
 if type "python3" > /dev/null;
 then
-    odoo_modules="$(python3 -B -c "import configparser ; c = configparser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
+    odoo_modules="$(python3 -B -c "import configparser ; c = configparser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
 else
     odoo_modules="$(python2 -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
 fi
@@ -21,7 +21,7 @@
 then
     if type "python3" > /dev/null;
     then
-	python3 -B -c "import configparser ; c = configparser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print(','.join(c.get('odoo_scripts', 'module_list').split()))" > $project_home/odoo_modules_list
+	python3 -B -c "import configparser ; c = configparser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print(','.join(c.get('odoo_scripts', 'module_list').split()))" > $project_home/odoo_modules_list
     else
 	python2 -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print(','.join(c.get('odoo_scripts', 'module_list').split()))" > $project_home/odoo_modules_list
     fi