|
1 |
| -#!/usr/bin/env python |
| 1 | +#!/usr/bin/env python3 |
2 | 2 |
|
3 | 3 | # Copyright 2020 The Crashpad Authors. All rights reserved.
|
4 | 4 | #
|
|
23 | 23 | import subprocess
|
24 | 24 | import sys
|
25 | 25 | import tempfile
|
26 |
| - |
27 |
| -try: |
28 |
| - import configparser |
29 |
| -except ImportError: |
30 |
| - import ConfigParser as configparser |
31 |
| - |
32 |
| -try: |
33 |
| - import StringIO as io |
34 |
| -except ImportError: |
35 |
| - import io |
| 26 | +import configparser |
| 27 | +import io |
36 | 28 |
|
37 | 29 | SUPPORTED_TARGETS = ('iphoneos', 'iphonesimulator')
|
38 | 30 | SUPPORTED_CONFIGS = ('Debug', 'Release', 'Profile', 'Official', 'Coverage')
|
39 | 31 |
|
40 | 32 |
|
41 |
| -class ConfigParserWithStringInterpolation(configparser.SafeConfigParser): |
| 33 | +class ConfigParserWithStringInterpolation(configparser.ConfigParser): |
42 | 34 | '''A .ini file parser that supports strings and environment variables.'''
|
43 | 35 |
|
44 | 36 | ENV_VAR_PATTERN = re.compile(r'\$([A-Za-z0-9_]+)')
|
45 | 37 |
|
46 | 38 | def values(self, section):
|
47 |
| - return map(lambda kv: self._UnquoteString(self._ExpandEnvVar(kv[1])), |
48 |
| - configparser.ConfigParser.items(self, section)) |
| 39 | + return [self._UnquoteString(self._ExpandEnvVar(kv[1])) for kv in configparser.ConfigParser.items(self, section)] |
49 | 40 |
|
50 | 41 | def getstring(self, section, option):
|
51 | 42 | return self._UnquoteString(self._ExpandEnvVar(self.get(section,
|
@@ -110,7 +101,7 @@ def _GetGnArgs(self):
|
110 | 101 | args.append(('target_cpu', target_cpu))
|
111 | 102 | args.append(
|
112 | 103 | ('additional_target_cpus',
|
113 |
| - [cpu for cpu in cpu_values.itervalues() if cpu != target_cpu])) |
| 104 | + [cpu for cpu in cpu_values.values() if cpu != target_cpu])) |
114 | 105 | else:
|
115 | 106 | args.append(('target_cpu', cpu_values[build_arch]))
|
116 | 107 |
|
|
0 commit comments