Python 3.10 tag issubclass bug: (#832)
This commit is contained in:
parent
c3148d348c
commit
a52145e52a
@ -67,7 +67,7 @@ class Tag(Base):
|
|||||||
if isinstance(prop, Var):
|
if isinstance(prop, Var):
|
||||||
if not prop.is_local or prop.is_string:
|
if not prop.is_local or prop.is_string:
|
||||||
return str(prop)
|
return str(prop)
|
||||||
if issubclass(prop.type_, str):
|
if types._issubclass(prop.type_, str):
|
||||||
return format.json_dumps(prop.full_name)
|
return format.json_dumps(prop.full_name)
|
||||||
prop = prop.full_name
|
prop = prop.full_name
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from typing import Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -41,6 +41,16 @@ def mock_event(arg):
|
|||||||
),
|
),
|
||||||
({"a": "red", "b": "blue"}, '{{"a": "red", "b": "blue"}}'),
|
({"a": "red", "b": "blue"}, '{{"a": "red", "b": "blue"}}'),
|
||||||
(BaseVar(name="var", type_="int"), "{var}"),
|
(BaseVar(name="var", type_="int"), "{var}"),
|
||||||
|
(
|
||||||
|
BaseVar(
|
||||||
|
name="_",
|
||||||
|
type_=Any,
|
||||||
|
state="",
|
||||||
|
is_local=True,
|
||||||
|
is_string=False,
|
||||||
|
),
|
||||||
|
"{_}",
|
||||||
|
),
|
||||||
(BaseVar(name='state.colors["a"]', type_="str"), '{state.colors["a"]}'),
|
(BaseVar(name='state.colors["a"]', type_="str"), '{state.colors["a"]}'),
|
||||||
({"a": BaseVar(name="val", type_="str")}, '{{"a": val}}'),
|
({"a": BaseVar(name="val", type_="str")}, '{{"a": val}}'),
|
||||||
({"a": BaseVar(name='"val"', type_="str")}, '{{"a": "val"}}'),
|
({"a": BaseVar(name='"val"', type_="str")}, '{{"a": "val"}}'),
|
||||||
|
Loading…
Reference in New Issue
Block a user