Skip to content

Commit

Permalink
Check the "maximum recursion depth exceeded" message directly in the …
Browse files Browse the repository at this point in the history
…error `args`

No further decoding is needed here now.
  • Loading branch information
prusse-martin committed Apr 8, 2016
1 parent a47c94f commit f8e7bb5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions _pytest/_code/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,7 @@ def repr_traceback(self, excinfo):
traceback = traceback.filter()
recursionindex = None
if excinfo.errisinstance(RuntimeError):
error_message = excinfo.value.message
if isinstance(error_message, bytes): # python 2 only
error_message = error_message.decode(errors='replace')
if "maximum recursion depth exceeded" in error_message:
if "maximum recursion depth exceeded" in excinfo.value.args:
recursionindex = traceback.recursionindex()
last = traceback[-1]
entries = []
Expand Down

0 comments on commit f8e7bb5

Please sign in to comment.