We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70ffb2b commit dab0c11Copy full SHA for dab0c11
hwilib/descriptor.py
@@ -432,9 +432,12 @@ def _get_func_expr(s: str) -> Tuple[str, str]:
432
:return: The function name as the first element of the tuple, and the expression contained within the function as the second element
433
:raises: ValueError: if a matching pair of parentheses cannot be found
434
"""
435
- start = s.index("(")
436
- end = s.rindex(")")
437
- return s[0:start], s[start + 1:end]
+ try:
+ start = s.index("(")
+ end = s.rindex(")")
438
+ return s[0:start], s[start + 1:end]
439
+ except ValueError:
440
+ raise ValueError("A matching pair of parentheses cannot be found")
441
442
443
def _get_const(s: str, const: str) -> str:
0 commit comments