code: def convert_old_variant_handle(handle_dict):
      
      old_variables = handle_dict.get("variables", {})
      variables = dict(repository_type="filesystem")
  
      for old_key, key in variant_key_conversions.iteritems():
          value = old_variables.get(old_key)
          #if value is not None:
          variables[key] = value
  
      path = handle_dict["path"]
      filename = os.path.basename(path)
      if os.path.splitext(filename)[0] == "package":
          key = "filesystem.variant"
      else:
          key = "filesystem.variant.combined"
  
      return dict(key=key, variables=variables)
docs: Convert a variant handle from serialize_version < 4.0.