diff --git a/clients/gemini_live/gemini_client.py b/clients/gemini_live/gemini_client.py index f03a761..5a473bc 100644 --- a/clients/gemini_live/gemini_client.py +++ b/clients/gemini_live/gemini_client.py @@ -343,13 +343,20 @@ async def run(self): await send_text_task raise asyncio.CancelledError("User requested exit") - except asyncio.CancelledError: - # Normal exit when user types 'q' - print("\nGoodbye!") - pass - except asyncio.ExceptionGroup as exception_group: + except* Exception as exception_group: # Handle any errors that occurred in the task group - traceback.print_exception(exception_group) + # Check if it's a CancelledError (normal exit) + if any( + isinstance(exc, asyncio.CancelledError) + for exc in exception_group.exceptions + ): + print("\nGoodbye!") + else: + traceback.print_exception( + type(exception_group), + exception_group, + exception_group.__traceback__, + ) def main(): diff --git a/pyproject.toml b/pyproject.toml index ac6f939..c6ae149 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "robot-mcp-client" version = "0.1.0" description = "Connect AI Language Models with Robots on ROS using MCP" readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.11" authors = [ { name = "Stefano Dalla Gasperina"}, { name = "Rohit John Varghese"}, diff --git a/setup.sh b/setup.sh index 20d706e..dc49fca 100755 --- a/setup.sh +++ b/setup.sh @@ -16,7 +16,7 @@ esac echo "Detected OS: $PLATFORM" -# Ensure Python 3.10+ +# Ensure Python 3.11+ (Note: uv will auto-download the correct version if needed) ensure_python() { case "$PLATFORM" in mac) @@ -25,7 +25,7 @@ ensure_python() { echo "Installing Python via Homebrew..." brew install python@3.11 || brew install python@3.12 else - echo "Install Python 3.10+ from https://www.python.org/downloads/" + echo "Install Python 3.11+ from https://www.python.org/downloads/" fi fi ;; @@ -39,13 +39,13 @@ ensure_python() { elif command -v pacman >/dev/null 2>&1; then sudo pacman -S --noconfirm python python-virtualenv else - echo "Install Python 3.10+ using your package manager" + echo "Install Python 3.11+ using your package manager" fi fi ;; windows) if ! command -v python >/dev/null 2>&1 && ! command -v python3 >/dev/null 2>&1; then - echo "Install Python 3.10+ from https://www.python.org/downloads/ and add to PATH" + echo "Install Python 3.11+ from https://www.python.org/downloads/ and add to PATH" fi ;; esac