File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
python-packages/smithy-python/smithy_python/_private/http Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1515
1616
1717from collections import Counter , OrderedDict
18+ from collections .abc import Iterable
1819from dataclasses import dataclass , field
19- from typing import Any , Iterable , Protocol
20+ from typing import Any , Protocol
2021from urllib .parse import urlparse , urlunparse
2122
2223from ... import interfaces
@@ -132,11 +133,11 @@ class Field(interfaces.http.Field):
132133 def __init__ (
133134 self ,
134135 name : str ,
135- value : list [str ] | None = None ,
136+ value : Iterable [str ] | None = None ,
136137 kind : FieldPosition = FieldPosition .HEADER ,
137138 ):
138139 self .name = name
139- self .value : list [str ] = value if value is not None else []
140+ self .value : list [str ] = [ val for val in value ] if value is not None else []
140141 self .kind = kind
141142
142143 def add (self , value : str ) -> None :
@@ -211,7 +212,7 @@ def quote_and_escape_field_value(value: str) -> str:
211212class Fields (interfaces .http .Fields ):
212213 def __init__ (
213214 self ,
214- initial : list [interfaces .http .Field ] | None = None ,
215+ initial : Iterable [interfaces .http .Field ] | None = None ,
215216 * ,
216217 encoding : str = "utf-8" ,
217218 ):
You can’t perform that action at this time.
0 commit comments