From c0a402906260b1ff4151003aa668359bc061ba61 Mon Sep 17 00:00:00 2001 From: Shen Qin <82353723+shen-qin@users.noreply.github.com> Date: Mon, 21 Aug 2023 18:24:52 +0800 Subject: [PATCH] Fix 'coroutine' object has no attribute 'stats' error in analysis results for upload_files.py (#157) --- .gitignore | 2 ++ examples/upload_files.py | 1 + vt/client.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b77bbfe..1a8dc5b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ vt_py.egg-info /.idea .vscode/ + +.DS_Store diff --git a/examples/upload_files.py b/examples/upload_files.py index f253b83..4764b27 100644 --- a/examples/upload_files.py +++ b/examples/upload_files.py @@ -56,6 +56,7 @@ async def process_analysis_results(apikey, analysis, file_path): async with vt.Client(apikey) as client: completed_analysis = await client.wait_for_analysis_completion(analysis) print(f'{file_path}: {completed_analysis.stats}') + print(f'analysis id: {completed_analysis.id}') async def main(): diff --git a/vt/client.py b/vt/client.py index 3dd6f3d..3442721 100644 --- a/vt/client.py +++ b/vt/client.py @@ -758,4 +758,4 @@ async def _wait_for_analysis_completion(self, analysis): return analysis async def wait_for_analysis_completion(self, analysis): - return self._wait_for_analysis_completion(analysis) + return await self._wait_for_analysis_completion(analysis)