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

Updates #2619.
This commit is contained in:
Chris Johns 2016-03-10 14:52:25 +11:00
parent 334c22c12d
commit 29f23e0440
2 changed files with 4 additions and 3 deletions

View File

@ -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()

View File

@ -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