Skip to content

Commit b58f201

Browse files
author
Sebastian Ramacher
committed
Merging bugfixes from 0.10-bugfix.
2 parents acee0d3 + 8239fa3 commit b58f201

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

bpython/cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,9 @@ def settext(self, s, c=None, p=False):
15751575
self.c = c
15761576

15771577
if s:
1578+
if not py3 and isinstance(s, unicode):
1579+
s = s.encode(getpreferredencoding())
1580+
15781581
if self.c:
15791582
self.win.addstr(s, self.c)
15801583
else:

bpython/inspection.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,14 @@ def getargspec(func, f):
228228
# not take 'self', the latter would:
229229
func_name = getattr(f, '__name__', None)
230230

231-
is_bound_method = ((inspect.ismethod(f) and f.im_self is not None)
231+
try:
232+
is_bound_method = ((inspect.ismethod(f) and f.im_self is not None)
232233
or (func_name == '__init__' and not
233234
func.endswith('.__init__')))
235+
except:
236+
# if f is a method from a xmlrpclib.Server instance, func_name ==
237+
# '__init__' throws xmlrpclib.Fault (see #202)
238+
return None
234239
try:
235240
if py3:
236241
argspec = inspect.getfullargspec(f)

bpython/repl.py

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

752-
pasteservice = ServerProxy(self.config.pastebin_url)
752+
try:
753+
pasteservice = ServerProxy(self.config.pastebin_url)
754+
except IOError, e:
755+
self.interact.notify("Pastebin error for URL '%s': %s" %
756+
(self.config.pastebin_url, str(e)))
757+
return
753758

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

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def initialize_options(self):
5050
cmdclass['extract_messages'] = extract_messages
5151

5252

53-
if platform.system() == 'FreeBSD':
53+
if platform.system() in ['FreeBSD', 'OpenBSD']:
5454
man_dir = 'man'
5555
else:
5656
man_dir = 'share/man'

0 commit comments

Comments
 (0)