mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user