Skip to content

Commit

Permalink
wvtest: precompile _code() regex
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Browning <[email protected]>
Tested-by: Rob Browning <[email protected]>
  • Loading branch information
rlbdv committed Sep 10, 2016
1 parent 0527f5d commit af1e9c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wvtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ def _check(cond, msg = 'unknown', tb = None):
_result(msg, tb, 'FAILED')
return cond


_code_rx = re.compile(r'^\w+\((.*)\)(\s*#.*)?$')
def _code():
(filename, line, func, text) = traceback.extract_stack()[-3]
text = re.sub(r'^\w+\((.*)\)(\s*#.*)?$', r'\1', text);
return text
return _code_rx.sub(r'\1', text)



def WVMSG(message):
Expand Down

0 comments on commit af1e9c1

Please sign in to comment.