欢迎来到深圳外包网(szwbao.com)
当前位置:首页 > 技术学习 > 正文

tornado有TypeError(\"Unsupported timeout %r\" % timeout)报错是怎么

admin 发布于2024-05-16 13:00:51 技术学习 76 次

tornado有TypeError(\"Unsupported timeout %r\" % timeout)报错是怎么

import tornado.ioloop

def handle_timeout():
print("timeout occurred")

def start_timeout(timeout):
if not isinstance(timeout, (int,float)):
raise ValueError("timeout must be a number")
tornado.ioloop.IOLoop.current().call_later(timeout, handle_timeout)

try:
start_timeout(10) # this will work
start_timeout("10") # this will raise ValueError
except ValueError as e:
print(str(e))
登录后复制

转载请注明来源:tornado有TypeError(\"Unsupported timeout %r\" % timeout)报错是怎么

本文永久链接地址:http://szwbao.com/post/11072.html

郑重声明:
本站所有内容均由互联网收集整理、网友上传,并且以计算机技术研究交流为目的,仅供大家参考、学习,不存在任何商业目的与商业用途。若您需要商业运营或用于其他商业活动,请您购买正版授权并合法使用。
我们不承担任何技术及版权问题,且不对任何资源负法律责任。

最新文章
热门文章
网站分类