X Tutup
Skip to content

Commit 729f2ee

Browse files
committed
Catch socket.error when uploading a paste.
This closes issue #134.
1 parent 5be60b6 commit 729f2ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bpython/repl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from glob import glob
3636
from itertools import takewhile
3737
from locale import getpreferredencoding
38+
from socket import error as SocketError
3839
from string import Template
3940
from urllib import quote as urlquote
4041
from xmlrpclib import ServerProxy, Error as XMLRPCError
@@ -713,7 +714,7 @@ def pastebin(self, s=None):
713714
self.interact.notify('Posting data to pastebin...')
714715
try:
715716
paste_id = pasteservice.pastes.newPaste('pycon', s)
716-
except XMLRPCError, e:
717+
except (SocketError, XMLRPCError), e:
717718
self.interact.notify('Upload failed: %s' % (str(e), ) )
718719
return
719720

0 commit comments

Comments
 (0)
X Tutup