在异常块中捕获异常后,再次在try块中执行代码

时间:2019-10-26 21:24:23

标签: python python-3.x exception

我想在捕获异常后调用函数并在try块中再次执行代码

示例

def set_creds():
  # resets the credentials

def connect():
  try:
     # connect using credentials
  except CredentialsExpired:
     # here i want to call set_creds() and run try block again 

0 个答案:

没有答案