mirror of https://github.com/pyodide/pyodide.git
Don't print duplicate error message in chrome (#1144)
In chrome, the error message is contained in the stack. Avoid printing it twice.
This commit is contained in:
parent
3fef124b87
commit
293fefa7df
|
@ -52,12 +52,12 @@ class JavascriptException(Exception):
|
||||||
def __init__(self, msg, stack):
|
def __init__(self, msg, stack):
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
self.stack = stack
|
self.stack = stack
|
||||||
|
# In chrome the stack contains the message
|
||||||
|
if self.stack and self.stack.startswith(self.msg):
|
||||||
|
self.msg = ""
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.stack:
|
return "\n\n".join(x for x in [self.msg, self.stack] if x)
|
||||||
return self.msg + "\n\n" + self.stack
|
|
||||||
else:
|
|
||||||
return self.msg
|
|
||||||
|
|
||||||
|
|
||||||
class SeleniumWrapper:
|
class SeleniumWrapper:
|
||||||
|
|
Loading…
Reference in New Issue