|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- import datetime
- class test_log:# 数据库的整合类 这里随便写一个测试
- def execute(self, msg):
- print(msg)
- def commit(self):
- pass
- log = test_log()
- shop_id = 'nksncjskcdsk'
- def err_callback(error_info:tuple):
- log.execute(f"""INSERT INTO "main"."syncFailed"
- ("time", "shop_id", "goodscode", "errno", "error")
- VALUES
- ({datetime.datetime.now().isoformat(sep=' ')!r},
- {shop_id!r},
- 'slice_data',
- {error_info[0]!r},
- {error_info[1].replace("'",'').replace('"','')!r})
- """)
- log.commit()
- try:
- raise Exception("抛出一个异常",'错误码403')
- except Exception as e:
复制代码
设置中把静态检查工具pylance换成jedi试试?
感觉pylance还是有点小问题的
|
|