You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
chore: Enhance part_converter module to only import sys when needed and update the import error message
PiperOrigin-RevId: 776631415
This commit is contained in:
committed by
Copybara-Service
parent
9029b8a66e
commit
31e41bdd06
@@ -21,7 +21,6 @@ from __future__ import annotations
|
||||
import base64
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
from typing import Optional
|
||||
|
||||
from .utils import _get_adk_metadata_key
|
||||
@@ -29,10 +28,11 @@ from .utils import _get_adk_metadata_key
|
||||
try:
|
||||
from a2a import types as a2a_types
|
||||
except ImportError as e:
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3, 10):
|
||||
raise ImportError(
|
||||
'A2A Tool requires Python 3.10 or above. Please upgrade your Python'
|
||||
' version.'
|
||||
'A2A requires Python 3.10 or above. Please upgrade your Python version.'
|
||||
) from e
|
||||
else:
|
||||
raise e
|
||||
|
||||
Reference in New Issue
Block a user