美文网首页
catching classes that do not inh

catching classes that do not inh

作者: Leoguo小哥 | 来源:发表于2020-01-08 14:49 被阅读0次

修改python3源码:

class MobileErrorHandler(errorhandler.ErrorHandler):

def check_response(self, response):

try:

super(MobileErrorHandler, self).check_response(response)

except WebDriverExceptionas wde:

if wde.msg =='No such context found.':

raise NoSuchContextException(wde.msg, wde.screen, wde.stacktrace)

else:

raise wde

修改为:

class MobileErrorHandler(errorhandler.ErrorHandler, BaseException):

def check_response(self, response):

try:

super(MobileErrorHandler, self).check_response(response)

except WebDriverExceptionas wde:

if wde.msg =='No such context found.':

raise NoSuchContextException(wde.msg, wde.screen, wde.stacktrace)

else:

raise wde

相关文章

网友评论

      本文标题:catching classes that do not inh

      本文链接:https://www.haomeiwen.com/subject/uiksactx.html