Skip to content

Commit f096dd5

Browse files
author
Sebastian Ramacher
committed
Catch IOError from ServerProxy (Closes: #207)
Thanks to myint for the patch.
1 parent ec5950e commit f096dd5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bpython/repl.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,12 @@ def pastebin(self, s=None):
716716
self.interact.notify("Pastebin aborted")
717717
return
718718

719-
pasteservice = ServerProxy(self.config.pastebin_url)
719+
try:
720+
pasteservice = ServerProxy(self.config.pastebin_url)
721+
except IOError, e:
722+
self.interact.notify("Pastebin error for URL '%s': %s" %
723+
(self.config.pastebin_url, str(e)))
724+
return
720725

721726
if s == self.prev_pastebin_content:
722727
self.interact.notify('Duplicate pastebin. Previous URL: ' +

0 commit comments

Comments
 (0)