[rtems-source-builder commit] sb: Fix configparser import on Python2 in version.py.

Chris Johns chrisj at rtems.org
Thu Mar 10 03:55:49 UTC 2016


Module:    rtems-source-builder
Branch:    4.11
Commit:    eaab26a41fe96d8f0f940ec41cabed73760d2bd5
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=eaab26a41fe96d8f0f940ec41cabed73760d2bd5

Author:    Chris Johns <chrisj at rtems.org>
Date:      Thu Mar 10 14:52:25 2016 +1100

sb: Fix configparser import on Python2 in version.py.

Updates #2619.

---

 source-builder/sb-set-builder | 2 --
 source-builder/sb/version.py  | 5 ++++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/source-builder/sb-set-builder b/source-builder/sb-set-builder
index 52e122b..561199e 100755
--- a/source-builder/sb-set-builder
+++ b/source-builder/sb-set-builder
@@ -24,8 +24,6 @@ import sys, os
 base = os.path.dirname(sys.argv[0])
 sys.path.insert(0, base + '/sb')
 
-import setbuilder
-
 try:
     import setbuilder
     setbuilder.run()
diff --git a/source-builder/sb/version.py b/source-builder/sb/version.py
index e53476f..7f8efea 100644
--- a/source-builder/sb/version.py
+++ b/source-builder/sb/version.py
@@ -50,7 +50,10 @@ def _load_released_version_config():
     top = _top()
     for ver in [top, '..']:
         if path.exists(path.join(ver, 'VERSION')):
-            import configparser
+            try:
+                import configparser
+            except ImportError:
+                import ConfigParser as configparser
             v = configparser.SafeConfigParser()
             v.read(path.join(ver, 'VERSION'))
             return v




More information about the vc mailing list