SwiftBuildSupport.py: Python 3 compatibility fixes

This change allows me to get `update-checkout` and `build-script`
running with Python 3.
This commit is contained in:
Dmitri Gribenko
2015-12-25 10:04:42 +02:00
parent 7576a91009
commit 259fb78e48

View File

@@ -10,7 +10,11 @@
from __future__ import print_function
import ConfigParser
try:
import ConfigParser # Python 2
except ImportError:
import configparser as ConfigParser # Python 3
import os
import pipes
import subprocess
@@ -132,7 +136,7 @@ def _get_preset_options_impl(config, substitutions, preset_name):
for o in config.options(section_name):
try:
a = config.get(section_name, o)
except ConfigParser.InterpolationMissingOptionError, e:
except ConfigParser.InterpolationMissingOptionError as e:
# e.reference contains the correctly formatted option
missing_opts.append(e.reference)
continue