Skip to content

Commit

Permalink
Use str instead of repr for exception message
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Tolfsen <ato@mozilla.com>
  • Loading branch information
bayandin authored and andreastt committed Oct 18, 2014
1 parent 6557783 commit 5669de3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions py/selenium/common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ def __init__(self, msg=None, screen=None, stacktrace=None):
self.stacktrace = stacktrace

def __str__(self):
exception_msg = "Message: %s " % repr(self.msg)
exception_msg = "Message: %s\n" % self.msg
if self.screen is not None:
exception_msg = "%s; Screenshot: available via screen " \
% exception_msg
exception_msg += "Screenshot: available via screen\n"
if self.stacktrace is not None:
exception_msg = "%s; Stacktrace: %s " \
% (exception_msg, str("\n" + "\n".join(self.stacktrace)))
stacktrace = "\n".join(self.stacktrace)
exception_msg += "Stacktrace:\n%s" % stacktrace
return exception_msg

class ErrorInResponseException(WebDriverException):
Expand Down

0 comments on commit 5669de3

Please sign in to comment.