Skip to content

Commit 763a66e

Browse files
committed
Issue #134 fixed
1 parent 81914ff commit 763a66e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bpython/repl.py

Lines changed: 3 additions & 2 deletions
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,8 +714,8 @@ 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-
self.interact.notify('Upload failed: %s' % (str(e), ) )
717+
except (XMLRPCError, socketerror), e:
718+
self.interact.notify('Upload failed: %s' % e)
718719
return
719720

720721
paste_url_template = Template(self.config.pastebin_show_url)

0 commit comments

Comments
 (0)