@@ -90,12 +90,12 @@ def _convert_positive(manifest: dict, field: str):
9090 def _convert_boolean (manifest : dict , field : str ):
9191 if field in manifest :
9292 field_value = manifest [field ]
93- manifest [field ] = field_value if type (field_value ) == bool else field_value .lower () == "true"
93+ manifest [field ] = field_value if isinstance (field_value , bool ) else field_value .lower () == "true"
9494
9595 @staticmethod
9696 def _validate_routes (manifest : dict ):
9797 for route in manifest .get ("routes" , []):
98- if type ( route ) != dict or "route" not in route :
98+ if not ( isinstance ( route , dict )) or "route" not in route :
9999 raise AssertionError ("routes attribute must be a list of object containing a route attribute" )
100100
101101 @staticmethod
@@ -125,11 +125,14 @@ def _absolute_path(manifest_directory: str, manifest: dict):
125125 def _convert_environment (app_manifest : dict ):
126126 environment = app_manifest .get ("env" )
127127 if environment is not None :
128- if type ( environment ) != dict :
128+ if not ( isinstance ( environment , dict )) :
129129 raise AssertionError ("'env' entry must be a dictionary" )
130130 app_manifest ["env" ] = {
131- key : json .dumps (value ) for key , value in environment .items () if value is not None and type (value ) != str
131+ key : json .dumps (value ) for key , value in environment .items ()
132+ if value is not None and not (isinstance (value , str ))
133+ }
134+ app_manifest ["env" ].update ({
135+ key : value for key , value in environment .items ()
136+ if value is not None and isinstance (value , str )
132137 }
133- app_manifest ["env" ].update (
134- {key : value for key , value in environment .items () if value is not None and type (value ) == str }
135138 )
0 commit comments