kogawananari 发表于 2021-7-22 11:38:51

vscode f字符串 红线 但运行不报错

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!r},
                        {error_info.replace("'",'').replace('"','')!r})
                """)
    log.commit()


try:
    raise Exception("抛出一个异常",'错误码403')
except Exception as e:

hrp 发表于 2021-7-22 11:59:37

设置中把静态检查工具pylance换成jedi试试?
感觉pylance还是有点小问题的

kogawananari 发表于 2021-7-22 12:12:53

hrp 发表于 2021-7-22 11:59
设置中把静态检查工具pylance换成jedi试试?
感觉pylance还是有点小问题的

给pylance提了issue {:10_293:}

kogawananari 发表于 2021-7-22 16:52:16

hrp 发表于 2021-7-22 11:59
设置中把静态检查工具pylance换成jedi试试?
感觉pylance还是有点小问题的

微软回复了我的issue:Thanks for the bug report. This will be fixed in the next release.
{:10_318:}

hrp 发表于 2021-7-22 17:00:39

kogawananari 发表于 2021-7-22 16:52
微软回复了我的issue:Thanks for the bug report. This will be fixed in the next release.
{:10_31 ...

这么快就确定是BUG了,可以哦
页: [1]
查看完整版本: vscode f字符串 红线 但运行不报错