mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-06 06:46:14 +01:00
Fix Field.origin_type for Optional types
This commit is contained in:
parent
3d7f79b706
commit
86e06a341f
@ -125,7 +125,7 @@ class Field(property):
|
|||||||
origin_type = get_origin(self.type) or self.type
|
origin_type = get_origin(self.type) or self.type
|
||||||
if self.is_optional:
|
if self.is_optional:
|
||||||
types = [i for i in self.type.__args__ if i != type(None)]
|
types = [i for i in self.type.__args__ if i != type(None)]
|
||||||
return types[0]
|
return get_origin(types[0]) or types[0]
|
||||||
return origin_type
|
return origin_type
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
Reference in New Issue
Block a user