Return value converted from Tcl object to Python object.
(val)
| 311 | return x |
| 312 | |
| 313 | def _tclobj_to_py(val): |
| 314 | """Return value converted from Tcl object to Python object.""" |
| 315 | if val and hasattr(val, '__len__') and not isinstance(val, str): |
| 316 | if getattr(val[0], 'typename', None) == 'StateSpec': |
| 317 | val = _list_from_statespec(val) |
| 318 | else: |
| 319 | val = list(map(_convert_stringval, val)) |
| 320 | |
| 321 | elif hasattr(val, 'typename'): # some other (single) Tcl object |
| 322 | val = _convert_stringval(val) |
| 323 | |
| 324 | return val |
| 325 | |
| 326 | def tclobjs_to_py(adict): |
| 327 | """Returns adict with its values converted from Tcl objects to Python |
no test coverage detected