refactor: move webbrowser import to top of file

This commit is contained in:
Paul Gauthier (aider) 2024-10-31 13:48:28 -07:00
parent 740534dcff
commit 25a906950c

View file

@ -13,6 +13,7 @@ import sys
import threading import threading
import time import time
import traceback import traceback
import webbrowser
from collections import defaultdict from collections import defaultdict
from datetime import datetime from datetime import datetime
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
@ -1145,8 +1146,6 @@ class Coder:
if self.io.confirm_ask( if self.io.confirm_ask(
"View this URL from the error message?", subject=url "View this URL from the error message?", subject=url
): ):
import webbrowser #ai move to top!
webbrowser.open(url) webbrowser.open(url)
break break
self.io.tool_output(f"Retrying in {retry_delay:.1f} seconds...") self.io.tool_output(f"Retrying in {retry_delay:.1f} seconds...")