Browse Source

Fix Python 2.7 compatibility

Fix regression from #20692
Scott Lahteine 3 years ago
parent
commit
8ffae97128
1 changed files with 10 additions and 10 deletions
  1. 10
    10
      buildroot/share/PlatformIO/scripts/common-dependencies.py

+ 10
- 10
buildroot/share/PlatformIO/scripts/common-dependencies.py View File

132
 	known_libs = get_all_known_libs()
132
 	known_libs = get_all_known_libs()
133
 	diff = (list(set(known_libs) - set(env_libs)))
133
 	diff = (list(set(known_libs) - set(env_libs)))
134
 	lib_ignore = env.GetProjectOption('lib_ignore') + diff
134
 	lib_ignore = env.GetProjectOption('lib_ignore') + diff
135
-	blab(f'Ignore libraries: {lib_ignore}')
135
+	blab("Ignore libraries: %s" % lib_ignore)
136
 	set_env_field('lib_ignore', lib_ignore)
136
 	set_env_field('lib_ignore', lib_ignore)
137
 
137
 
138
 def apply_features_config():
138
 def apply_features_config():
144
 		feat = FEATURE_CONFIG[feature]
144
 		feat = FEATURE_CONFIG[feature]
145
 
145
 
146
 		if 'lib_deps' in feat and len(feat['lib_deps']):
146
 		if 'lib_deps' in feat and len(feat['lib_deps']):
147
-			blab(f'Adding lib_deps for {feature}...')
147
+			blab("Adding lib_deps for %s... " % feature)
148
 
148
 
149
 			# feat to add
149
 			# feat to add
150
 			deps_to_add = {}
150
 			deps_to_add = {}
173
 
173
 
174
 		if 'build_flags' in feat:
174
 		if 'build_flags' in feat:
175
 			f = feat['build_flags']
175
 			f = feat['build_flags']
176
-			blab(f'Adding build_flags for {feature}: {f}')
176
+			blab("Adding build_flags for %s: %s" % (feature, f))
177
 			new_flags = env.GetProjectOption('build_flags') + [ f ]
177
 			new_flags = env.GetProjectOption('build_flags') + [ f ]
178
 			env.Replace(BUILD_FLAGS=new_flags)
178
 			env.Replace(BUILD_FLAGS=new_flags)
179
 
179
 
180
 		if 'extra_scripts' in feat:
180
 		if 'extra_scripts' in feat:
181
-			blab(f'Running extra_scripts for {feature}...')
181
+			blab("Running extra_scripts for %s... " % feature)
182
 			env.SConscript(feat['extra_scripts'], exports="env")
182
 			env.SConscript(feat['extra_scripts'], exports="env")
183
 
183
 
184
 		if 'src_filter' in feat:
184
 		if 'src_filter' in feat:
185
-			blab(f'Adding src_filter for {feature}...')
185
+			blab("Adding src_filter for %s... " % feature)
186
 			src_filter = ' '.join(env.GetProjectOption('src_filter'))
186
 			src_filter = ' '.join(env.GetProjectOption('src_filter'))
187
 			# first we need to remove the references to the same folder
187
 			# first we need to remove the references to the same folder
188
 			my_srcs = re.findall( r'[+-](<.*?>)', feat['src_filter'])
188
 			my_srcs = re.findall( r'[+-](<.*?>)', feat['src_filter'])
196
 			env.Replace(SRC_FILTER=src_filter)
196
 			env.Replace(SRC_FILTER=src_filter)
197
 
197
 
198
 		if 'lib_ignore' in feat:
198
 		if 'lib_ignore' in feat:
199
-			blab(f'Adding lib_ignore for {feature}...')
199
+			blab("Adding lib_ignore for %s... " % feature)
200
 			lib_ignore = env.GetProjectOption('lib_ignore') + [feat['lib_ignore']]
200
 			lib_ignore = env.GetProjectOption('lib_ignore') + [feat['lib_ignore']]
201
 			set_env_field('lib_ignore', lib_ignore)
201
 			set_env_field('lib_ignore', lib_ignore)
202
 
202
 
208
 def search_compiler():
208
 def search_compiler():
209
 	try:
209
 	try:
210
 		filepath = env.GetProjectOption('custom_gcc')
210
 		filepath = env.GetProjectOption('custom_gcc')
211
-		blab('Getting compiler from env')
211
+		blab("Getting compiler from env")
212
 		return filepath
212
 		return filepath
213
 	except:
213
 	except:
214
 		pass
214
 		pass
215
 
215
 
216
 	if os.path.exists(GCC_PATH_CACHE):
216
 	if os.path.exists(GCC_PATH_CACHE):
217
-		blab('Getting g++ path from cache')
217
+		blab("Getting g++ path from cache")
218
 		with open(GCC_PATH_CACHE, 'r') as f:
218
 		with open(GCC_PATH_CACHE, 'r') as f:
219
 			return f.read()
219
 			return f.read()
220
 
220
 
241
 			filepath = os.path.sep.join([pathdir, filepath])
241
 			filepath = os.path.sep.join([pathdir, filepath])
242
 			# Cache the g++ path to no search always
242
 			# Cache the g++ path to no search always
243
 			if os.path.exists(ENV_BUILD_PATH):
243
 			if os.path.exists(ENV_BUILD_PATH):
244
-				blab('Caching g++ for current env')
244
+				blab("Caching g++ for current env")
245
 				with open(GCC_PATH_CACHE, 'w+') as f:
245
 				with open(GCC_PATH_CACHE, 'w+') as f:
246
 					f.write(filepath)
246
 					f.write(filepath)
247
 
247
 
248
 			return filepath
248
 			return filepath
249
 
249
 
250
 	filepath = env.get('CXX')
250
 	filepath = env.get('CXX')
251
-	blab(f"Couldn't find a compiler! Fallback to {filepath}")
251
+	blab("Couldn't find a compiler! Fallback to %s" % filepath)
252
 	return filepath
252
 	return filepath
253
 
253
 
254
 #
254
 #

Loading…
Cancel
Save