(enum_type, arg)
| 256 | |
| 257 | |
| 258 | def enum_from_enum_or_str(enum_type, arg): |
| 259 | if isinstance(arg, enum_type): |
| 260 | return arg |
| 261 | elif isinstance(arg, str): |
| 262 | return enum_type[arg] |
| 263 | else: |
| 264 | raise Exception("can't create enum " + str(enum_type) + " from type " + str(type(arg))) |
| 265 | |
| 266 | |
| 267 | class EFstrType(Enum): |
no test coverage detected