@@ -120,7 +120,7 @@ def ensure_latest_bundle(bundle_url, bundle_s3_url, bundle_tag_file, bundle_data
120120 COMMUNITY_BUNDLE_S3_URL ,
121121 COMMUNITY_BUNDLE_TAG , COMMUNITY_BUNDLE_DATA )
122122
123- with open (ADAFRUIT_BUNDLE_DATA , "r" ) as f :
123+ with open (ADAFRUIT_BUNDLE_DATA , "r" , encoding = "utf-8" ) as f :
124124 bundle_data = json .load (f )
125125
126126with 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
130130def get_files_for_project (project_name ):
131131 """Get the set of files for a learn project"""
132132 found_files = set ()
133- project_dir = "{ }/{}/". format ( LEARN_GUIDE_REPO , project_name )
133+ project_dir = f" { LEARN_GUIDE_REPO } /{ project_name } /"
134134
135135 full_tree = os .walk (project_dir )
136136 root_level = next (full_tree )
@@ -160,11 +160,11 @@ def get_libs_for_project(project_name):
160160 """Get the set of libraries for a learn project"""
161161 found_libs = set ()
162162 found_imports = []
163- project_dir = "{}{ }/". format ( LEARN_GUIDE_REPO , project_name )
163+ project_dir = f" { LEARN_GUIDE_REPO } { project_name } /"
164164 for file in os .listdir (project_dir ):
165165 if file .endswith (".py" ):
166166
167- found_imports = findimports .find_imports ("{}{}" . format ( project_dir , file ) )
167+ found_imports = findimports .find_imports (f" { project_dir } { file } " )
168168
169169 for cur_import in found_imports :
170170 cur_lib = cur_import .name .split ("." )[0 ]
0 commit comments