Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion instalooter/_uadetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ def get_user_agent(port=None, cache=None):
# Use webbrowser to connect to the server with the default browser
webbrowser.open("http://localhost:{}/".format(port))
# Wait for the request handler to get the request from the browser
user_agent = UserAgentRequestHandler.queue.get()
try:
user_agent = UserAgentRequestHandler.queue.get(timeout=5)
except queue.Empty:
user_agent = None
# Close the server
server.shutdown()
server.server_close()
Expand Down