Skip to content

Commit e78b8e5

Browse files
jsquyresrhc54
authored andcommitted
construct_dictionary.py: make .format() safe for Python 2
Use field names with the string.format(...) so that Python 2 doesn't error. Using field names is done elsewhere in this script; it looks like this one place was missed as an oversight. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 627731e commit e78b8e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contrib/construct_dictionary.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Copyright (c) 2020 Intel, Inc. All rights reserved.
3-
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved
3+
# Copyright (c) 2020-2022 Cisco Systems, Inc. All rights reserved
44
# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
55
# Copyright (c) 2022 Triad National Security, LLC. All rights reserved.
66
# $COPYRIGHT$
@@ -254,14 +254,14 @@ def _write_header(options, base_path, num_elements):
254254
255255
BEGIN_C_DECLS
256256
257-
PMIX_EXPORT extern const pmix_regattr_input_t pmix_dictionary[{}];
257+
PMIX_EXPORT extern const pmix_regattr_input_t pmix_dictionary[{ne}];
258258
259-
#define PMIX_INDEX_BOUNDARY {}
259+
#define PMIX_INDEX_BOUNDARY {nem1}
260260
261261
END_C_DECLS
262262
263263
#endif\n
264-
'''.format(num_elements, num_elements - 1)
264+
'''.format(ne=num_elements, nem1=num_elements - 1)
265265

266266
if options.dryrun:
267267
constants = sys.stdout

0 commit comments

Comments
 (0)