Fix tests for check_for_urls

This commit is contained in:
Paul Gauthier 2024-07-28 16:48:59 -03:00
parent 3e1ad07069
commit 8a9184cef9
2 changed files with 11 additions and 7 deletions

View file

@ -664,7 +664,7 @@ class Coder:
return self.commands.run(inp)
self.check_for_file_mentions(inp)
inp = self.check_for_urls(inp)
self.check_for_urls(inp)
return inp
@ -676,7 +676,7 @@ class Coder:
inp += "\n\n"
inp += self.commands.cmd_web(url)
return inp
return urls
def keyboard_interrupt(self):
now = time.time()
@ -1227,12 +1227,13 @@ class Coder:
sys.stdout.write(text)
except UnicodeEncodeError:
# Safely encode and decode the text
safe_text = text.encode(sys.stdout.encoding, errors='backslashreplace').decode(sys.stdout.encoding)
safe_text = text.encode(sys.stdout.encoding, errors="backslashreplace").decode(
sys.stdout.encoding
)
sys.stdout.write(safe_text)
sys.stdout.flush()
yield text
def live_incremental_response(self, final):
show_resp = self.render_incremental_response(final)
self.mdstream.update(show_resp, final=final)