YAPM.Other¶
Random other functions.
- YAPM.Other.RaisesError(code: str, Ignore: Sequence[Exception] = [], GlobalVars: dict[str, any] = {})¶
Evaluates the code provited.
- Parameters:
code (str) – str - The code to eval
Ignore (Sequence[Exception]) – Exceptions to ignore
GlobalVars (dict[str, any]) – Globals to pass into the eval function
- Returns:
Tuple[True, any] - Code ran without any errors. returns code result.
Tuple[True, Exception] - Code threw a error that is in the Ignored exceptions list
Tuple[False, Exception] - Code threw a error that is not Ignored.’
- Raises:
ValueError - Ignore isn’t a iterable
ValueError - GlobalVars isn’t a dict
ValueError - Code isn’t a string