Skip to content

Commit 28f140f

Browse files
author
katiue
committed
not supressing anymore
1 parent 095fe3f commit 28f140f

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

webui.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import asyncio
1717
import argparse
1818
import os
19-
import warnings
20-
import socket
2119

2220
logger = logging.getLogger(__name__)
2321

@@ -53,19 +51,6 @@
5351
# Create the global agent state instance
5452
_global_agent_state = AgentState()
5553

56-
def suppress_connection_reset(func):
57-
async def wrapper(*args, **kwargs):
58-
try:
59-
return await func(*args, **kwargs)
60-
except ConnectionResetError:
61-
# Suppress the ConnectionResetError
62-
warnings.warn("Connection was reset. This is usually harmless.", RuntimeWarning)
63-
pass
64-
except socket.error as e:
65-
if e.winerror != 10054: # If it's not the specific connection reset error
66-
raise
67-
return wrapper
68-
6954
async def stop_agent():
7055
"""Request the agent to stop and update UI with enhanced feedback"""
7156
global _global_agent_state, _global_browser_context, _global_browser
@@ -553,7 +538,6 @@ async def run_with_stream(
553538
"Base": Base()
554539
}
555540

556-
@suppress_connection_reset
557541
async def close_global_browser():
558542
global _global_browser, _global_browser_context
559543

@@ -869,9 +853,6 @@ def list_recordings(save_recording_path):
869853
return demo
870854

871855
def main():
872-
# Suppress asyncio connection reset warnings
873-
warnings.filterwarnings("ignore", message=".*forcibly closed.*")
874-
875856
parser = argparse.ArgumentParser(description="Gradio UI for Browser Agent")
876857
parser.add_argument("--ip", type=str, default="127.0.0.1", help="IP address to bind to")
877858
parser.add_argument("--port", type=int, default=7788, help="Port to listen on")

0 commit comments

Comments
 (0)