1

我正在尝试从本地目录中异步删除文件;但是,我收到以下错误: object NoneType can't be used in 'await' expression ()

我正在使用 ver aiofiles 0.5.0 和 Python 3.6.5

我的代码很简单:

async def delete_local_file(file_to_del):
    await aiof.os.remove(file_to_del)
    print("deleted: "+file_to_del)

await delete_local_file(localfile)
4

1 回答 1

0

不小心我在导入过程中使用了错误的参考。只需使用:导入 aiofiles.os

于 2020-04-19T11:15:47.427 回答