mirror of
https://github.com/openSUSE/osc.git
synced 2025-09-27 22:17:13 +02:00
Fix how types are compared in OscOptions.set_value_from_string()
Some python versions require '==' instead of 'is' operator, otherwise we get TypeError: Field 'http_headers' has type 'typing.List[osc.conf.HttpHeader]'. Cannot assign a value with type 'str'.
This commit is contained in:
@@ -207,12 +207,12 @@ class OscOptions(BaseModel):
|
||||
setattr(self, field_name, None)
|
||||
return
|
||||
|
||||
if field.origin_type is Password:
|
||||
if field.origin_type == Password:
|
||||
value = Password(value)
|
||||
setattr(self, field_name, value)
|
||||
return
|
||||
|
||||
if field.type is List[HttpHeader]:
|
||||
if field.type == List[HttpHeader]:
|
||||
value = http.client.parse_headers(BytesIO(value.strip().encode("utf-8"))).items()
|
||||
setattr(self, field_name, value)
|
||||
return
|
||||
|
Reference in New Issue
Block a user