Skip to content

Commit c27f7fa

Browse files
committed
windows: use a local variable for extension entry
This is easier to read.
1 parent 90aff39 commit c27f7fa

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cpython-windows/build.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,30 +1180,32 @@ def find_additional_dependencies(project: pathlib.Path):
11801180
additional_depends = find_additional_dependencies(ext)
11811181
additional_depends -= CONVERT_TO_BUILTIN_EXTENSIONS.get(ext, {}).get('ignore_additional_depends', set())
11821182

1183-
res['extensions'][ext] = [{
1183+
entry = {
11841184
'in_core': False,
11851185
'objs': [],
11861186
'init_fn': 'PyInit_%s' % ext,
11871187
'static_lib': None,
11881188
'links': [{'name': n[:-4], 'system': True} for n in sorted(additional_depends)],
11891189
'variant': 'default',
1190-
}]
1190+
}
11911191

11921192
for obj in process_project(ext, dest_dir):
1193-
res['extensions'][ext][0]['objs'].append('build/extensions/%s/%s' % (ext, obj))
1193+
entry['objs'].append('build/extensions/%s/%s' % (ext, obj))
11941194

11951195
for lib in CONVERT_TO_BUILTIN_EXTENSIONS.get(ext, {}).get('static_depends', []):
1196-
res['extensions'][ext][0]['links'].append({
1196+
entry['links'].append({
11971197
'name': lib,
11981198
'path_static': 'build/lib/%s.lib' % lib,
11991199
})
12001200

12011201
for lib in CONVERT_TO_BUILTIN_EXTENSIONS.get(ext, {}).get('static_depends_no_project', []):
1202-
res['extensions'][ext][0]['links'].append({
1202+
entry['links'].append({
12031203
'name': lib,
12041204
'path_static': 'build/lib/%s.lib' % lib
12051205
})
12061206

1207+
res['extensions'][ext] = [entry]
1208+
12071209
# Copy the extension static library.
12081210
ext_static = outputs_path / ('%s.lib' % ext)
12091211
dest = dest_dir / ('%s.lib' % ext)

0 commit comments

Comments
 (0)