(value_type, value)
| 171 | |
| 172 | |
| 173 | def cast_argument_value(value_type, value): |
| 174 | if value_type == bool: |
| 175 | |
| 176 | def cast_func(value): |
| 177 | value = str(value) |
| 178 | return value.lower() in ["1", "true"] |
| 179 | |
| 180 | else: |
| 181 | cast_func = value_type |
| 182 | |
| 183 | result = cast_func(value) |
| 184 | return result |