Skip to content

Commit 31e41bd

Browse files
seanzhougooglecopybara-github
authored andcommitted
chore: Enhance part_converter module to only import sys when needed and update the import error message
PiperOrigin-RevId: 776631415
1 parent 9029b8a commit 31e41bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/google/adk/a2a/converters/part_converter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121
import base64
2222
import json
2323
import logging
24-
import sys
2524
from typing import Optional
2625

2726
from .utils import _get_adk_metadata_key
2827

2928
try:
3029
from a2a import types as a2a_types
3130
except ImportError as e:
31+
import sys
32+
3233
if sys.version_info < (3, 10):
3334
raise ImportError(
34-
'A2A Tool requires Python 3.10 or above. Please upgrade your Python'
35-
' version.'
35+
'A2A requires Python 3.10 or above. Please upgrade your Python version.'
3636
) from e
3737
else:
3838
raise e

0 commit comments

Comments
 (0)