Skip to content

Commit b117e3d

Browse files
committed
1.4.10
1 parent d25600b commit b117e3d

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

docs/source/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ Glossary
2626
Releases
2727
---------------------
2828

29+
v1.4.10
30+
=====================
31+
- Fixed string casting sometimes being cast to a list type.
32+
33+
2934
v1.4.8 / v1.4.9
3035
=====================
3136
- Fixed :class:`tkclasswiz.convert.convert_objects_to_script` function:

tkclasswiz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
SOFTWARE.
2828
"""
2929

30-
__version__ = "1.4.9"
30+
__version__ = "1.4.10"
3131

3232

3333
from .object_frame import *

tkclasswiz/object_frame/frame_base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,13 @@ def cast_type(cls, value: Any, types: Iterable):
168168
dict: lambda v: convert_to_object_info(json.loads(v))
169169
}
170170

171-
for type_ in filter(lambda t: t.__module__ == "builtins", types):
171+
172+
types = list(filter(lambda t: t.__module__ == "builtins", types))
173+
174+
if isinstance(value, str) and str in types:
175+
return value
176+
177+
for type_ in types:
172178
with suppress(Exception):
173179
cast_funct = CAST_FUNTIONS.get(type_)
174180
if cast_funct is None:

0 commit comments

Comments
 (0)