add try except becuse i hate this
This commit is contained in:
parent
47734388a7
commit
5a0475d588
@ -429,8 +429,11 @@ class Var(Generic[VAR_TYPE]):
|
|||||||
return self.to(EventVar, output)
|
return self.to(EventVar, output)
|
||||||
if fixed_output_type is EventChain:
|
if fixed_output_type is EventChain:
|
||||||
return self.to(EventChainVar, output)
|
return self.to(EventChainVar, output)
|
||||||
if issubclass(fixed_output_type, Base):
|
try:
|
||||||
return self.to(ObjectVar, output)
|
if issubclass(fixed_output_type, Base):
|
||||||
|
return self.to(ObjectVar, output)
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
if dataclasses.is_dataclass(fixed_output_type) and not issubclass(
|
if dataclasses.is_dataclass(fixed_output_type) and not issubclass(
|
||||||
fixed_output_type, Var
|
fixed_output_type, Var
|
||||||
):
|
):
|
||||||
@ -568,8 +571,11 @@ class Var(Generic[VAR_TYPE]):
|
|||||||
return self.to(EventVar, self._var_type)
|
return self.to(EventVar, self._var_type)
|
||||||
if issubclass(fixed_type, EventChain):
|
if issubclass(fixed_type, EventChain):
|
||||||
return self.to(EventChainVar, self._var_type)
|
return self.to(EventChainVar, self._var_type)
|
||||||
if issubclass(fixed_type, Base):
|
try:
|
||||||
return self.to(ObjectVar, self._var_type)
|
if issubclass(fixed_type, Base):
|
||||||
|
return self.to(ObjectVar, self._var_type)
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
if dataclasses.is_dataclass(fixed_type):
|
if dataclasses.is_dataclass(fixed_type):
|
||||||
return self.to(ObjectVar, self._var_type)
|
return self.to(ObjectVar, self._var_type)
|
||||||
return self
|
return self
|
||||||
|
Loading…
Reference in New Issue
Block a user