@@ -120,7 +120,7 @@ def ensure_latest_bundle(bundle_url, bundle_s3_url, bundle_tag_file, bundle_data
120
120
COMMUNITY_BUNDLE_S3_URL ,
121
121
COMMUNITY_BUNDLE_TAG , COMMUNITY_BUNDLE_DATA )
122
122
123
- with open (ADAFRUIT_BUNDLE_DATA , "r" ) as f :
123
+ with open (ADAFRUIT_BUNDLE_DATA , "r" , encoding = "utf-8" ) as f :
124
124
bundle_data = json .load (f )
125
125
126
126
with open (COMMUNITY_BUNDLE_DATA , "r" ) as f :
@@ -130,7 +130,7 @@ def ensure_latest_bundle(bundle_url, bundle_s3_url, bundle_tag_file, bundle_data
130
130
def get_files_for_project (project_name ):
131
131
"""Get the set of files for a learn project"""
132
132
found_files = set ()
133
- project_dir = "{ }/{}/". format ( LEARN_GUIDE_REPO , project_name )
133
+ project_dir = f" { LEARN_GUIDE_REPO } /{ project_name } /"
134
134
135
135
full_tree = os .walk (project_dir )
136
136
root_level = next (full_tree )
@@ -160,11 +160,11 @@ def get_libs_for_project(project_name):
160
160
"""Get the set of libraries for a learn project"""
161
161
found_libs = set ()
162
162
found_imports = []
163
- project_dir = "{}{ }/". format ( LEARN_GUIDE_REPO , project_name )
163
+ project_dir = f" { LEARN_GUIDE_REPO } { project_name } /"
164
164
for file in os .listdir (project_dir ):
165
165
if file .endswith (".py" ):
166
166
167
- found_imports = findimports .find_imports ("{}{}" . format ( project_dir , file ) )
167
+ found_imports = findimports .find_imports (f" { project_dir } { file } " )
168
168
169
169
for cur_import in found_imports :
170
170
cur_lib = cur_import .name .split ("." )[0 ]
0 commit comments